Module: Relish::Command

Defined in:
lib/relish/command.rb,
lib/relish/commands/dsl.rb,
lib/relish/commands/base.rb,
lib/relish/commands/help.rb,
lib/relish/commands/push.rb,
lib/relish/commands/config.rb,
lib/relish/commands/projects.rb

Defined Under Namespace

Modules: Dsl Classes: Base, Config, Help, Projects, Push

Class Method Summary collapse

Class Method Details

.get_command_and_method(command, args) ⇒ Object



16
17
18
19
# File 'lib/relish/command.rb', line 16

def self.get_command_and_method(command, args)
  command_class, method = command.split(':')
  return Relish::Command.const_get(command_class.capitalize), (method || :default)
end

.run(command, args) ⇒ Object



11
12
13
14
# File 'lib/relish/command.rb', line 11

def self.run(command, args)
  command_class, method = get_command_and_method(command, args)      
  command_class.new(args).send(method)
end