module CfScript::Command

Attributes

_registry[R]

Public Instance Methods

method_missing(m, *args, &block) click to toggle source
# File lib/cf_script/command.rb, line 29
def method_missing(m, *args, &block)
  run(m, *args, &block)
end
register(command_class) click to toggle source
# File lib/cf_script/command.rb, line 15
def register(command_class)
  registry.add!(command_class)
end
registry() click to toggle source
# File lib/cf_script/command.rb, line 11
def registry
  @_registry ||= Registry.new
end
run(command_name, *args, &block) click to toggle source
# File lib/cf_script/command.rb, line 19
def run(command_name, *args, &block)
  registry.check!(command_name)

  begin
    registry[command_name].run(*args, &block)
  rescue StandardError => e
    error command_name, e.message
  end
end