class RBT::CompileBaseSystem

Public Class Methods

[](i = '') click to toggle source
#

RBT::CompileBaseSystem[]

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 129
def self.[](i = '')
  new(i)
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 28
def initialize(
    i           = nil,
    run_already = true
  )
  reset
  set_input(i)
  case i
  when :dont_run_yet,
       :do_not_run_yet
    i = nil
    run_already = false
  end
  case run_already
  when :dont_run_yet,
       :do_not_run_yet
    run_already = false
  end
  run if run_already
end
report_which_programs_will_be_compiled() click to toggle source
#

RBT::CompileBaseSystem.report_which_programs_will_be_compiled

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 136
def self.report_which_programs_will_be_compiled
  array = RBT::CompileBaseSystem.new(:do_not_run_yet).programs?
  _ = "#{array.size} programs"
  if RBT.use_colours?
    _ = Colours.sfancy(_)
  end
  RBT.e "The following #{_}, for a basic linux system, will be compiled:"
  RBT.e
  print '  '; RBT.e array.join('; ')
  RBT.e
end

Public Instance Methods

array_compile_these_programs?() click to toggle source
#

array_compile_these_programs?

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 77
def array_compile_these_programs?
  @array_compile_these_programs
end
Also aliased as: programs?
do_compile_the_programs() click to toggle source
#

do_compile_the_programs

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 100
def do_compile_the_programs
  array_compile_these_programs?.each {|this_program|
    opne 'Now compiling the program `'+sfancy(this_program)+
         '` (via an AppDir prefix).'
    @compile.reset # Reset internally before continuing.
    @compile.do_compile_this_program(this_program) { :use_appdir_prefix }
  }
end
input?() click to toggle source
#

input?

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 93
def input?
  @input
end
notify_the_user_what_this_program_will_be_doing() click to toggle source
#

notify_the_user_what_this_program_will_be_doing

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 112
def notify_the_user_what_this_program_will_be_doing
  opne "This class will compile "\
       "#{sfancy(@array_compile_these_programs.size.to_s)}"\
       " programs."
end
programs?()
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::LeanPrototype#reset
# File lib/rbt/utility_scripts/compile_base_system.rb, line 51
def reset
  super()
  infer_the_namespace
  # ======================================================================= #
  # === @array_compile_these_programs
  #
  # Next comes the Array for the programs that will be compiled.
  # Ideally, the programs that are more important than the others,
  # should come first. All of these programs must be compiled
  # via an AppDir prefix.
  # ======================================================================= #
  @array_compile_these_programs = %i(
    make
    sed
    awk
    coreutils
    utillinux
    gawk
    m4
  )
  @compile = RBT::Action::Installer.new(:do_not_run_yet)
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 121
def run
  notify_the_user_what_this_program_will_be_doing
  do_compile_the_programs
end
set_input(i = '') click to toggle source
#

set_input

#
# File lib/rbt/utility_scripts/compile_base_system.rb, line 84
def set_input(i = '')
  i = i.first if i.is_a? Array
  i = i.to_s.dup
  @input = i
end