Class: LoadRunner::CommandLine

Inherits:
SuperDocopt::Base
  • Object
show all
Includes:
Colsole
Defined in:
lib/load_runner/command_line.rb

Overview

Handles the command line interface

Instance Method Summary collapse

Instance Method Details

#send_eventObject



14
15
16
17
18
# File 'lib/load_runner/command_line.rb', line 14

def send_event
  client = Client.new client_opts
  response = client.send_event args['EVENT'], payload_opts
  show response
end

#serverObject



20
21
22
23
# File 'lib/load_runner/command_line.rb', line 20

def server
  Server.prepare port: args['--port'], bind: args['--bind']
  Server.run!
end

#statusObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/load_runner/command_line.rb', line 25

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