class RBT::ProfileInstall

Constants

FILE_INSTALLATION_PROCEDURE
WHICH_SUBSECTION_TO_USE
#

WHICH_SUBSECTION_TO_USE

#

Public Class Methods

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

ProfileInstall[]

#
# File lib/rbt/utility_scripts/profile_install.rb, line 161
def self.[](i = '')
  self.new(i)
end
new( which_subsection_to_use = WHICH_SUBSECTION_TO_USE, run_already = true ) click to toggle source
#

initialize

Invocation examples:

rpinstall testing
#
# File lib/rbt/utility_scripts/profile_install.rb, line 53
def initialize(
    which_subsection_to_use = WHICH_SUBSECTION_TO_USE,
    run_already             = true
  )
  reset
  set_which_subsection_to_use(which_subsection_to_use)
  run if run_already
end

Public Instance Methods

compile_program(i)
Alias for: compile_programs
compile_programs(i) click to toggle source
#

compile_programs

Use this method to compile all things in the section.

#
# File lib/rbt/utility_scripts/profile_install.rb, line 146
def compile_programs(i)
  RBT.do_compile(i)
end
Also aliased as: compile_program
process_after_split(splitted) click to toggle source
#

process_after_split

After splitting, we enter this method and process further.

splitted must be an array.

#
# File lib/rbt/utility_scripts/profile_install.rb, line 125
def process_after_split(splitted)
  _ = splitted.first
  case _ # case tag
  when 'rm'
    ewarn ' => Removing a file now:'
    e splitted[1]
    remove_file splitted[1]
  when 'ry'
    ewarn ' => Compiling a program next:'
    e splitted[1]
    compile_programs splitted[1]
  else
    compile_program(_)
  end
end
process_data() click to toggle source
#

process_data

#
# File lib/rbt/utility_scripts/profile_install.rb, line 103
def process_data
  if @yaml_file_dataset.has_key? @which_subsection_to_use
    @yaml_file_dataset[@which_subsection_to_use].each { |entry|
      efancy entry
      if entry.include? ';'
        tmp = entry.split ';'
        tmp.each { |entry| process_after_split( entry.split(' ') ) }
      else
        splitted = entry.split ' '
        process_after_split splitted 
      end
    }
  end
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/profile_install.rb, line 65
def reset
  super()
  @yaml_file_location = FILE_INSTALLATION_PROCEDURE
  if File.exist? @yaml_file_location
    @yaml_file_dataset  = YAML.load_file(@yaml_file_location) # Base this info on the line before.
  end
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/profile_install.rb, line 153
def run
  sanitize_subsection 
  process_data
end
sanitize_subsection() click to toggle source
#

sanitize_subsection

Sanitizes the variable @which_subsection_to_use, so that we can pass short-hand notations.

#
# File lib/rbt/utility_scripts/profile_install.rb, line 94
def sanitize_subsection
  unless @which_subsection_to_use.include? 'gobolinux'
    @which_subsection_to_use.gsub!(/gobo/,'gobolinux')
  end
end
set_which_subsection_to_use(i = WHICH_SUBSECTION_TO_USE) click to toggle source
#

set_which_subsection_to_use

#
# File lib/rbt/utility_scripts/profile_install.rb, line 76
def set_which_subsection_to_use(i = WHICH_SUBSECTION_TO_USE)
  i = WHICH_SUBSECTION_TO_USE if i.nil?  
  @which_subsection_to_use = i.to_s # Needs be a String.
end
which_subsection_to_use?() click to toggle source
#

which_subsection_to_use?

#
# File lib/rbt/utility_scripts/profile_install.rb, line 84
def which_subsection_to_use?
  @which_subsection_to_use
end