class RBT::ShowDependenciesOfThisLibrary

Public Class Methods

new( i = ARGV, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/show_dependencies_of_this_library.rb, line 19
def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  set_commandline_arguments(i)
  run if run_already
end

Public Instance Methods

menu( i = commandline_arguments? ) click to toggle source
#

menu (menu tag)

#
report( i, search_term = first_argument? ) click to toggle source
#

report (report tag)

#
# File lib/rbt/utility_scripts/show_dependencies_of_this_library.rb, line 39
def report(
    i,
    search_term = first_argument?
  )
  search_term = search_term.to_s
  if i.empty?
    opnerev 'No library was found to depend on '+
            lightblue(search_term)+"#{rev}."
  else
    opnerev 'The following libraries have a dependency on '+
             lightblue(search_term)+rev+':'
    e
    i.each_with_index {|entry, index| index += 1
      e "  #{royalblue(index)}) #{steelblue(entry)}"
    }
    e
  end
end
reset() click to toggle source
#

reset

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

run

#
# File lib/rbt/utility_scripts/show_dependencies_of_this_library.rb, line 85
def run
  menu
  dataset = action(:LddDataset)
  search_term = first?
  # ======================================================================= #
  # Need to find the selection next:
  # ======================================================================= #
  new_dataset = dataset.select {|key, value|
    value.include?(search_term)
  }
  report(new_dataset.keys, search_term)
end