class RBT::CompileIntoHomeDir

Public Class Methods

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

RBT::CompileIntoHomeDir[]

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 125
def self.[](i = ARGV)
  new(i)
end
new( i = ARGV, run_already = true ) { || ... } click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 29
def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  set_compile_these_programs(
    i
  )
  if block_given?
    yielded = yield
    set_commandline_arguments(yielded)
  end
  run if run_already
end

Public Instance Methods

compile_which_programs?() click to toggle source
#

compile_which_programs?

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 87
def compile_which_programs?
  @compile_these_programs
end
reset() click to toggle source
#

reset (reset tag)

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

run (run tag)

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 103
def run
  # ======================================================================= #
  # Instantiate our compile-object next, which will be adjusted properly.
  # ======================================================================= #
  _ = RBT::Action::Installer.new(:do_not_run_yet)
  compile_these_programs = compile_which_programs?
  compile_these_programs.each {|this_program|
    opne "Now attempting to compile the program `#{orange(this_program)}`."
    _.reset
    _.set_compile_this_program(this_program)
    _.prepare_dataset_for(this_program)
    _.set_user_prefix('$HOME') # Designate our prefix to HOME here.
    if without_symlinking? # Here we disallow symlinking.
      _.do_not_symlink { :be_verbose }
    end
    _.do_compile_this_program(this_program)
  }
end
sanitize_compile_these_programs() click to toggle source
#

sanitize_compile_these_programs

Currently this method will only replace numbers with the corresponding entry from the file called “installation_procedure.yml” If that file does not exist then this method will currently not do anything.

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 68
def sanitize_compile_these_programs
  _ = RBT.file_installation_procedere
  if File.exist? _
    dataset = YAML.load_file(_)['default']
    @compile_these_programs.map! {|entry|
      if entry and entry.match?(/^\d+$/)
        # ================================================================= #
        # Find the replacement next.
        # ================================================================= #
        entry = dataset[entry.to_i - 1]
      end
      entry
    }
  end
end
set_compile_these_programs(i) click to toggle source
#

set_compile_these_programs

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 56
def set_compile_these_programs(i)
  @compile_these_programs = [i].flatten.compact
  sanitize_compile_these_programs
end
without_symlinking?() click to toggle source
#

without_symlinking?

#
# File lib/rbt/utility_scripts/compile_into_home_dir.rb, line 94
def without_symlinking?
  commandline_arguments?.any? {|entry|
    entry == :without_symlinking
  }
end