Class: LoadRunner::CommandLine
- Inherits:
-
SuperDocopt::Base
- Object
- SuperDocopt::Base
- LoadRunner::CommandLine
- Includes:
- Colsole
- Defined in:
- lib/load_runner/command_line.rb
Overview
Handles the command line interface
Instance Method Summary collapse
Instance Method Details
#event ⇒ Object
14 15 16 17 18 |
# File 'lib/load_runner/command_line.rb', line 14 def event client = Client.new client_opts response = client.send_event args['EVENT'], payload_opts show response end |
#payload ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/load_runner/command_line.rb', line 20 def payload client = Client.new client_opts file = args['FILE'] raise ArgumentError, "File not found: #{file}" unless File.exist? file json = File.read file response = client.send_payload args['EVENT'], json show response end |
#server ⇒ Object
30 31 32 33 |
# File 'lib/load_runner/command_line.rb', line 30 def server Server.prepare port: args['--port'], bind: args['--bind'] Server.run! end |
#status ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/load_runner/command_line.rb', line 35 def status api = GitHubAPI.new opts = { state: args['STATE'], target_url: args['--url'], context: args['--context'], description: args['--desc'] } response = api.status args['REPO'], args['SHA'], opts show response end |