Module: Runner
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Methods included from Validator
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/airbrake/cli/runner.rb', line 12 def @options end |
Instance Method Details
#run!(command, cli_options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/airbrake/cli/runner.rb', line 14 def run!(command, = {}) self. = Options.new() case command when 'raise' validates :api_key Airbrake.configure do |c| c.api_key = .api_key c.host = .host if .host c.port = .port if .port c.secure = .port.to_i == 443 end exception_id = Airbrake.notify(:error_class => .error, :error_message => "#{.error}: #{.}", :cgi_data => ENV) abort "Error sending exception to Airbrake server. Try again later." unless exception_id puts "Exception sent successfully: http://airbrake.io/locate/#{exception_id}" when "list" validates :auth_token, :account Client.print_projects when "create" validates :auth_token, :account Client.create_project when "deploy" validates :api_key Client.create_deploy else Printer.print_usage end end |