class RBT::SystemCompilePossibilities

Constants

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 29
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 66
def check_gcc_version(i = :gcc)
  local_version = EnvironmentInformation.return_version_of_gcc?
  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_gmp_version(i = :gmp) click to toggle source
#

check_gmp_version

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 51
def check_gmp_version(i = :gmp)
  local_version = EnvironmentInformation.return_version_of_gmp?
  e "GMP 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 81
def check_sed_version(i = :sed)
  local_version = EnvironmentInformation.return_version_of_sed?
  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 96
def consider_compiling_this_program(i)
  if TRY_TO_COMPILE_THE_PROGRAM_IF_IT_IS_OUTDATED
    opne "#{rev}Next trying to compile `#{sfancy(i.to_s)}#{rev}`."
    action(:Installer, i)
  end
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 43
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/system_compile_possibilities.rb, line 106
def run
  require 'environment_information'
  check_sed_version # (1)
  check_gcc_version # (2)
  check_gmp_version # (3)
end