class RBT::BinaryNameBelongsToWhichProgram

Public Class Methods

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

RBT::BinaryNameBelongsToWhichProgram[]

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

initialize

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 30
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::LeanPrototype#reset
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 44
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 52
def run
  first = first_argument?
  all_registered_binaries = RBT.hash_registered_binaries?
  if all_registered_binaries.has_key? first
    belongs_to = all_registered_binaries[first]
    opne "#{rev}The binary called `#{royalblue(first)}#{rev}` belongs to"
    opne "the program `#{orange(belongs_to)}#{rev}`."
  else
    opne "#{rev}The program called `#{royalblue(first)}#{rev}` does "\
         "not appear to be registered"
    opne 'with any particular program.'
  end
end