Class: Wakame::Cli::Subcommand::Actor

Inherits:
Object
  • Object
show all
Includes:
Wakame::Cli::Subcommand
Defined in:
lib/wakame/runner/administrator_command.rb

Instance Method Summary collapse

Methods included from Wakame::Cli::Subcommand

#create_parser, included, #print_result

Instance Method Details

#parse(args) ⇒ Object



845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/wakame/runner/administrator_command.rb', line 845

def parse(args)
  @params = {}
  cmd = create_parser(args) { |opts|
    opts.banner = "Usage: actor [options] \"Agent ID\" \"/actor/path\" [\"args\"]"
    opts.separator ""
    opts.separator "options:"
  }
  @params[:agent_id] = args.shift || abort("[ERROR]: Agent ID was not given")
  @params[:path] = args.shift || abort("[ERROR]: Path was not given")
  @params[:args] = args.shift
  @params
end

#run(requester) ⇒ Object



858
859
860
# File 'lib/wakame/runner/administrator_command.rb', line 858

def run(requester)
  requester.request(@params)
end