class RBT::ExtraInformation

Public Class Methods

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

RBT::ExtraInformation[]

#
# File lib/rbt/utility_scripts/extra_information.rb, line 72
def self.[](i = ARGV)
  new(i)
end
new( commandline_arguments = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/extra_information.rb, line 29
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Public Instance Methods

reset() click to toggle source
#

reset (reset tag)

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

run (run tag)

#
# File lib/rbt/utility_scripts/extra_information.rb, line 50
def run
  # ======================================================================= #
  # We will either instantiate a new cookbook, or we will use the dataset
  # from the expanded cookbook file.
  # ======================================================================= #
  _ = first_argument?
  if expanded_cookbook_file_exists_for?(_)
    # ===================================================================== #
    # This variant is faster, so it will be checked first.
    # ===================================================================== #
    file = path_to_this_expanded_cookbooks_dataset(_)
    use_this_key = 'extra_information'.to_sym
    dataset = YAML.load_file(file)[use_this_key]
  else
    dataset = ::RBT::Cookbooks::SanitizeCookbook.new(_) { :fast }.extra_information?
  end
  e dataset
end