class Hivent::CLI::Runner

Constants

OPTION_PARSERS

Public Class Methods

new(argv) click to toggle source
# File lib/hivent/cli/runner.rb, line 19
def initialize(argv)
  @argv = argv
  @command = @argv.shift.to_s.to_sym
end

Public Instance Methods

run() click to toggle source
# File lib/hivent/cli/runner.rb, line 24
def run
  if parser = OPTION_PARSERS[@command]
    send(@command, parser.new(@command, @argv).parse)
  else
    puts help
  end
end

Private Instance Methods

help() click to toggle source
# File lib/hivent/cli/runner.rb, line 38
      def help
        <<-EOS.strip_heredoc
          Available COMMANDs are:
             start  :  starts one or multiple the consumer
          See 'hivent COMMAND --help' for more information on a specific command.
        EOS
      end
start(options) click to toggle source
# File lib/hivent/cli/runner.rb, line 34
def start(options)
  Consumer.run!(options)
end