Method: God::CLI::Command#dispatch

Defined in:
lib/god/cli/command.rb

#dispatchObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/god/cli/command.rb', line 26

def dispatch
  if %w{load status signal log quit terminate}.include?(@command)
    setup
    send("#{@command}_command")
  elsif %w{start stop restart monitor unmonitor remove}.include?(@command)
    setup
    lifecycle_command
  elsif @command == 'check'
    check_command
  else
    puts "Command '#{@command}' is not valid. Run 'god --help' for usage"
    abort
  end
end