Class: Blazemeter::Command::Help
- Inherits:
-
Blazemeter::Command
- Object
- Blazemeter::Command
- Blazemeter::Command::Help
- Defined in:
- lib/blazemeter/command/help.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Blazemeter::Command
Instance Method Summary collapse
Methods included from Utils
Instance Method Details
#cmd_default(argv) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/blazemeter/command/help.rb', line 4 def cmd_default argv puts "Usage: blazemeter <command> <options>" helps = [ { :cmd => 'help', :help => 'Display this help' }, { :cmd => 'help:locations', :help => 'Display list of available test geo locations' }, { :cmd => 'api:init', :help => 'Store your API key' }, { :cmd => 'api:reset', :help => 'Remove your API key' }, { :cmd => 'api:validoptions', :help => 'Returns a list of available options that can be used for test creation or modification.' }, { :cmd => 'test:create', :help => 'generate blazemeter test' }, { :cmd => 'test:start', :help => 'starts blazemeter test' }, { :cmd => 'test:stop', :help => 'stops blazemeter test' }, { :cmd => 'test:update', :help => 'updates blazemeter test' }, { :cmd => 'test:status', :help => 'show blazemeter test status' }, { :cmd => 'test:options', :help => 'show blazemeter test options' }, { :cmd => 'test:query', :help => 'returns the report (a zip file)' } ] max_cmd_size = helps.inject(0) { |memo, obj| [ obj[:cmd].size, memo ].max } + 4 helps.each do |h| puts "%*s - %s" % [max_cmd_size, h[:cmd], h[:help]] end puts end |
#cmd_locations(argv) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/blazemeter/command/help.rb', line 28 def cmd_locations argv helps = [ { :cmd => 'eu-west-1', :help => 'EU West (Ireland)' }, { :cmd => 'us-east-1', :help => 'US East (Virginia)' }, { :cmd => 'us-west-1', :help => 'US West (N.California)' }, { :cmd => 'us-west-2', :help => 'US West (Oregon)' }, { :cmd => 'sa-east-1', :help => 'South America(Sao Paulo)' }, { :cmd => 'ap-southeast-1', :help => 'Asia Pacific (Singapore)' }, { :cmd => 'ap-southeast-2', :help => 'Australia (Sydney)' }, { :cmd => 'ap-northeast-1', :help => 'Japan (Tokyo)' } ] max_cmd_size = helps.inject(0) { |memo, obj| [ obj[:cmd].size, memo ].max } + 4 helps.each do |h| puts "%*s - %s" % [max_cmd_size, h[:cmd], h[:help]] end puts end |