Method: RR::CommandRunner.register

Defined in:
lib/rubyrep/command_runner.rb

.register(commands) ⇒ Object

Registers one or multiple commands. commands is a hash with

  • key: name of the command

  • value: a command hash defining the command

A command hash consists of

  • :description: short description of the command

  • :command: an object / class implementing the hash.

    Must have a method
    
    # runs a command
    # * +args+: array of command line parameters
    #           note: will not contain the command name itself.
    def run(args)
    


29
30
31
# File 'lib/rubyrep/command_runner.rb', line 29

def self.register(commands)
  self.commands.merge!(commands)
end