class RBT::BinaryNameBelongsToWhichProgram

Constants

NAMESPACE
#

NAMESPACE

#

Public Class Methods

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

RBT::BinaryNameBelongsToWhichProgram[]

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 86
def self.[](i = '')
  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 32
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Public Instance Methods

commandline_arguments?() click to toggle source
#

commandline_arguments?

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 62
def commandline_arguments?
  @commandline_arguments
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 46
def reset
  super()
  @namespace = NAMESPACE
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 69
def run
  first = @commandline_arguments.first
  all_registered_binaries = RBT.hash_registered_binaries?
  if all_registered_binaries.has_key? first
    belongs_to = all_registered_binaries[first]
    opnn; e "The binary called `#{royalblue(first)}` belongs to the "\
            "program `#{orange(belongs_to)}`."
  else
    opnn; e "The program called `#{royalblue(first)}` does not appear "\
            "to be registered "
    opnn; e 'with any particular program.'
  end
end
set_commandline_arguments(i = '') click to toggle source
#

set_input

#
# File lib/rbt/utility_scripts/binary_name_belongs_to_which_program.rb, line 54
def set_commandline_arguments(i = '')
  i = [i].flatten.compact
  @commandline_arguments = i
end