class RBT::SystemCompilePossibilities

Constants

NAMESPACE
#

NAMESPACE

#
TRY_TO_COMPILE_THE_PROGRAM_IF_IT_IS_OUTDATED
#

TRY_TO_COMPILE_THE_PROGRAM_IF_IT_IS_OUTDATED

If the following constant is set to true, then this class will also try to compile the program at hand if it is outdated.

#

Public Class Methods

new( commandline_arguments = ARGV, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 33
def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  reset
  set_commandline_arguments(commandline_arguments)
  run if run_already
end

Public Instance Methods

check_gcc_version(i = :gcc) click to toggle source
#

check_gcc_version

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 60
def check_gcc_version(i = :gcc)
  local_version = EnvironmentInformation.return_gcc_version
  e "GCC Version: #{sfancy(local_version)}"
  # ======================================================================= #
  # Next check if we could update the GCC version:
  # ======================================================================= #
  current_version_is = RBT.swift_return_version_of_this_program(i)
  if local_version < current_version_is
    consider_compiling_this_program(i)
  end
end
check_sed_version(i = :sed) click to toggle source
#

check_sed_version

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 75
def check_sed_version(i = :sed)
  local_version = EnvironmentInformation.return_sed_version
  e 'Sed Version: '+sfancy(local_version)
  current_version_is = RBT.swift_return_version_of_this_program(i)
  if local_version < current_version_is
    consider_compiling_this_program(i)
  end
end
consider_compiling_this_program(i) click to toggle source
#

consider_compiling_this_program

This method will honour a constant, before it will attempt to compile anything.

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 90
def consider_compiling_this_program(i)
  if TRY_TO_COMPILE_THE_PROGRAM_IF_IT_IS_OUTDATED
    opnn; e 'Next trying to compile `'+sfancy(i.to_s)+'`.'
    RBT::Compile.new(i)
  end
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 52
def reset
  super()
  @namespace = NAMESPACE
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 100
def run
  require 'environment_information'
  check_sed_version # (1)
  check_gcc_version # (2)
end
set_commandline_arguments(i) click to toggle source
#

set_commandline_arguments

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 45
def set_commandline_arguments(i)
  @commandline_arguments = i
end