Class: Honeybadger::CLI::Main Private

Inherits:
Thor
  • Object
show all
Defined in:
lib/honeybadger/cli/main.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.project_optionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
29
30
# File 'lib/honeybadger/cli/main.rb', line 26

def self.project_options
  option :api_key,         required: false, aliases: :'-k', type: :string, desc: 'Api key of your Honeybadger application'
  option :environment,     required: false, aliases: [:'-e', :'-env'], type: :string, desc: 'Environment this command is being executed in (i.e. "production", "staging")'
  option :skip_rails_load, required: false, type: :boolean, desc: 'Flag to skip rails initialization'
end

Instance Method Details

#deployObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/honeybadger/cli/main.rb', line 76

def deploy
  config = build_config(options)

  if config.get(:api_key).to_s =~ BLANK
    say("No value provided for required options '--api-key'")
    exit(1)
  end

  Deploy.new(options, [], config).run
rescue => e
  log_error(e)
  exit(1)
end

#exec(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/honeybadger/cli/main.rb', line 116

def exec(*args)
  if args.size == 0
    say("honeybadger: exec needs a command to run", :red)
    exit(1)
  end

  config = build_config(options)

  if config.get(:api_key).to_s =~ BLANK
    say("No value provided for required options '--api-key'", :red)
    exit(1)
  end

  Exec.new(options, args, config).run
rescue => e
  log_error(e)
  exit(1)
end

#help(*args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/honeybadger/cli/main.rb', line 32

def help(*args, &block)
  if args.size == 0
    say(<<-WELCOME)
⚡  Honeybadger v#{VERSION}

Honeybadger is your favorite error tracker for Ruby. When your app raises an
exception we notify you with all the context you need to fix it.

The Honeybadger CLI provides tools for interacting with Honeybadger via the
command line.

If you need support, please drop us a line: [email protected]

WELCOME
  end
  super
end

#install(api_key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



54
55
56
57
58
59
# File 'lib/honeybadger/cli/main.rb', line 54

def install(api_key)
  Install.new(options, api_key).run
rescue => e
  log_error(e)
  exit(1)
end

#notifyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/honeybadger/cli/main.rb', line 99

def notify
  config = build_config(options)

  if config.get(:api_key).to_s =~ BLANK
    say("No value provided for required options '--api-key'")
    exit(1)
  end

  Notify.new(options, [], config).run
rescue => e
  log_error(e)
  exit(1)
end

#testObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



64
65
66
67
68
69
# File 'lib/honeybadger/cli/main.rb', line 64

def test
  Test.new(options).run
rescue => e
  log_error(e)
  exit(1)
end