honeybadger 5.29.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/lib/honeybadger/agent.rb +36 -35
- data/lib/honeybadger/backend/base.rb +11 -11
- data/lib/honeybadger/backend/debug.rb +4 -4
- data/lib/honeybadger/backend/null.rb +2 -2
- data/lib/honeybadger/backend/server.rb +11 -11
- data/lib/honeybadger/backend/test.rb +2 -2
- data/lib/honeybadger/backend.rb +6 -6
- data/lib/honeybadger/backtrace.rb +27 -22
- data/lib/honeybadger/breadcrumbs/active_support.rb +9 -9
- data/lib/honeybadger/breadcrumbs/breadcrumb.rb +1 -2
- data/lib/honeybadger/breadcrumbs/collector.rb +4 -4
- data/lib/honeybadger/breadcrumbs/logging.rb +11 -14
- data/lib/honeybadger/breadcrumbs.rb +3 -3
- data/lib/honeybadger/cli/deploy.rb +7 -7
- data/lib/honeybadger/cli/exec.rb +41 -41
- data/lib/honeybadger/cli/helpers.rb +18 -18
- data/lib/honeybadger/cli/heroku.rb +36 -36
- data/lib/honeybadger/cli/install.rb +44 -44
- data/lib/honeybadger/cli/main.rb +107 -107
- data/lib/honeybadger/cli/notify.rb +13 -13
- data/lib/honeybadger/cli/test.rb +109 -94
- data/lib/honeybadger/cli.rb +3 -3
- data/lib/honeybadger/config/defaults.rb +218 -218
- data/lib/honeybadger/config/env.rb +5 -5
- data/lib/honeybadger/config/ruby.rb +19 -19
- data/lib/honeybadger/config/yaml.rb +12 -12
- data/lib/honeybadger/config.rb +76 -78
- data/lib/honeybadger/const.rb +4 -4
- data/lib/honeybadger/context_manager.rb +1 -2
- data/lib/honeybadger/conversions.rb +9 -6
- data/lib/honeybadger/counter.rb +4 -4
- data/lib/honeybadger/event.rb +3 -3
- data/lib/honeybadger/events_worker.rb +33 -33
- data/lib/honeybadger/gauge.rb +2 -2
- data/lib/honeybadger/histogram.rb +4 -4
- data/lib/honeybadger/init/hanami.rb +5 -5
- data/lib/honeybadger/init/rails.rb +14 -14
- data/lib/honeybadger/init/rake.rb +19 -21
- data/lib/honeybadger/init/ruby.rb +4 -4
- data/lib/honeybadger/init/sinatra.rb +11 -12
- data/lib/honeybadger/instrumentation.rb +26 -31
- data/lib/honeybadger/instrumentation_helper.rb +11 -12
- data/lib/honeybadger/karafka.rb +55 -56
- data/lib/honeybadger/logging.rb +22 -21
- data/lib/honeybadger/metric.rb +2 -2
- data/lib/honeybadger/metrics_worker.rb +12 -10
- data/lib/honeybadger/notice.rb +55 -58
- data/lib/honeybadger/notification_subscriber.rb +14 -14
- data/lib/honeybadger/plugin.rb +16 -18
- data/lib/honeybadger/plugins/active_job.rb +11 -9
- data/lib/honeybadger/plugins/autotuner.rb +5 -5
- data/lib/honeybadger/plugins/breadcrumbs.rb +7 -7
- data/lib/honeybadger/plugins/delayed_job/plugin.rb +36 -37
- data/lib/honeybadger/plugins/delayed_job.rb +4 -4
- data/lib/honeybadger/plugins/faktory.rb +9 -9
- data/lib/honeybadger/plugins/karafka.rb +3 -3
- data/lib/honeybadger/plugins/lambda.rb +9 -11
- data/lib/honeybadger/plugins/local_variables.rb +4 -4
- data/lib/honeybadger/plugins/net_http.rb +10 -10
- data/lib/honeybadger/plugins/passenger.rb +4 -4
- data/lib/honeybadger/plugins/rails.rb +13 -9
- data/lib/honeybadger/plugins/resque.rb +7 -7
- data/lib/honeybadger/plugins/shoryuken.rb +6 -6
- data/lib/honeybadger/plugins/sidekiq.rb +61 -57
- data/lib/honeybadger/plugins/solid_queue.rb +3 -3
- data/lib/honeybadger/plugins/sucker_punch.rb +5 -5
- data/lib/honeybadger/plugins/system.rb +3 -3
- data/lib/honeybadger/plugins/thor.rb +5 -5
- data/lib/honeybadger/plugins/warden.rb +4 -4
- data/lib/honeybadger/rack/error_notifier.rb +14 -14
- data/lib/honeybadger/rack/user_feedback.rb +11 -12
- data/lib/honeybadger/rack/user_informer.rb +6 -6
- data/lib/honeybadger/registry.rb +2 -2
- data/lib/honeybadger/registry_execution.rb +1 -1
- data/lib/honeybadger/ruby.rb +2 -2
- data/lib/honeybadger/singleton.rb +49 -48
- data/lib/honeybadger/tasks.rb +3 -3
- data/lib/honeybadger/timer.rb +1 -1
- data/lib/honeybadger/util/http.rb +27 -27
- data/lib/honeybadger/util/request_hash.rb +11 -11
- data/lib/honeybadger/util/request_payload.rb +2 -2
- data/lib/honeybadger/util/revision.rb +14 -6
- data/lib/honeybadger/util/sanitizer.rb +22 -22
- data/lib/honeybadger/util/stats.rb +6 -3
- data/lib/honeybadger/version.rb +1 -1
- data/lib/honeybadger/worker.rb +31 -29
- data/lib/honeybadger.rb +5 -5
- data/lib/puma/plugin/honeybadger.rb +12 -8
- metadata +3 -3
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "forwardable"
|
2
|
+
require "honeybadger/cli/main"
|
3
|
+
require "honeybadger/cli/helpers"
|
4
|
+
require "honeybadger/util/http"
|
5
5
|
|
6
6
|
module Honeybadger
|
7
7
|
module CLI
|
@@ -19,9 +19,9 @@ module Honeybadger
|
|
19
19
|
def run
|
20
20
|
payload = {
|
21
21
|
environment: config.get(:env),
|
22
|
-
revision: options[
|
23
|
-
repository: options[
|
24
|
-
local_username: options[
|
22
|
+
revision: options["revision"],
|
23
|
+
repository: options["repository"],
|
24
|
+
local_username: options["user"]
|
25
25
|
}
|
26
26
|
|
27
27
|
response = config.backend.notify(:deploys, payload)
|
data/lib/honeybadger/cli/exec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
1
|
+
require "erb"
|
2
|
+
require "forwardable"
|
3
|
+
require "honeybadger/cli/main"
|
4
|
+
require "honeybadger/cli/helpers"
|
5
|
+
require "honeybadger/util/http"
|
6
|
+
require "honeybadger/util/stats"
|
7
|
+
require "open3"
|
8
|
+
require "ostruct"
|
9
|
+
require "thor/shell"
|
10
10
|
|
11
11
|
module Honeybadger
|
12
12
|
module CLI
|
@@ -14,34 +14,34 @@ module Honeybadger
|
|
14
14
|
extend Forwardable
|
15
15
|
include Helpers::BackendCmd
|
16
16
|
|
17
|
-
FAILED_TEMPLATE =
|
18
|
-
Honeybadger detected failure or error output for the command:
|
19
|
-
`<%= args.join(' ') %>`
|
20
|
-
|
21
|
-
PROCESS ID: <%= pid %>
|
22
|
-
|
23
|
-
RESULT CODE: <%= code %>
|
24
|
-
|
25
|
-
ERROR OUTPUT:
|
26
|
-
<%= stderr %>
|
27
|
-
|
28
|
-
STANDARD OUTPUT:
|
29
|
-
<%= stdout %>
|
30
|
-
MSG
|
31
|
-
|
32
|
-
NO_EXEC_TEMPLATE =
|
33
|
-
Honeybadger failed to execute the following command:
|
34
|
-
`<%= args.join(' ') %>`
|
35
|
-
|
36
|
-
The command was not executable. Try adjusting permissions on the file.
|
37
|
-
MSG
|
38
|
-
|
39
|
-
NOT_FOUND_TEMPLATE =
|
40
|
-
Honeybadger failed to execute the following command:
|
41
|
-
`<%= args.join(' ') %>`
|
42
|
-
|
43
|
-
The command was not found. Make sure it exists in your PATH.
|
44
|
-
MSG
|
17
|
+
FAILED_TEMPLATE = <<~MSG
|
18
|
+
Honeybadger detected failure or error output for the command:
|
19
|
+
`<%= args.join(' ') %>`
|
20
|
+
|
21
|
+
PROCESS ID: <%= pid %>
|
22
|
+
|
23
|
+
RESULT CODE: <%= code %>
|
24
|
+
|
25
|
+
ERROR OUTPUT:
|
26
|
+
<%= stderr %>
|
27
|
+
|
28
|
+
STANDARD OUTPUT:
|
29
|
+
<%= stdout %>
|
30
|
+
MSG
|
31
|
+
|
32
|
+
NO_EXEC_TEMPLATE = <<~MSG
|
33
|
+
Honeybadger failed to execute the following command:
|
34
|
+
`<%= args.join(' ') %>`
|
35
|
+
|
36
|
+
The command was not executable. Try adjusting permissions on the file.
|
37
|
+
MSG
|
38
|
+
|
39
|
+
NOT_FOUND_TEMPLATE = <<~MSG
|
40
|
+
Honeybadger failed to execute the following command:
|
41
|
+
`<%= args.join(' ') %>`
|
42
|
+
|
43
|
+
The command was not found. Make sure it exists in your PATH.
|
44
|
+
MSG
|
45
45
|
|
46
46
|
def initialize(options, args, config)
|
47
47
|
@options = options
|
@@ -59,17 +59,17 @@ MSG
|
|
59
59
|
api_key: config.get(:api_key),
|
60
60
|
notifier: NOTIFIER,
|
61
61
|
error: {
|
62
|
-
class:
|
62
|
+
class: "honeybadger exec error",
|
63
63
|
message: result.msg
|
64
64
|
},
|
65
65
|
request: {
|
66
66
|
component: executable,
|
67
67
|
context: {
|
68
|
-
command: args.join(
|
68
|
+
command: args.join(" "),
|
69
69
|
code: result.code,
|
70
70
|
pid: result.pid,
|
71
71
|
pwd: Dir.pwd,
|
72
|
-
path: ENV[
|
72
|
+
path: ENV["PATH"]
|
73
73
|
}
|
74
74
|
},
|
75
75
|
server: {
|
@@ -112,7 +112,7 @@ MSG
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def exec_cmd
|
115
|
-
stdout, stderr, status = Open3.capture3(args.join(
|
115
|
+
stdout, stderr, status = Open3.capture3(args.join(" "))
|
116
116
|
|
117
117
|
success = status.success? && stderr =~ BLANK
|
118
118
|
pid = status.pid
|
@@ -3,24 +3,24 @@ module Honeybadger
|
|
3
3
|
module Helpers
|
4
4
|
module BackendCmd
|
5
5
|
def error_message(response)
|
6
|
-
host = config.get(:
|
7
|
-
|
8
|
-
!! --- Honeybadger request failed --------------------------------------------- !!
|
9
|
-
|
10
|
-
We encountered an error when contacting the server:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
To fix this issue, please try the following:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
!! --- End -------------------------------------------------------------------- !!
|
23
|
-
MSG
|
6
|
+
host = config.get(:"connection.host")
|
7
|
+
<<~MSG
|
8
|
+
!! --- Honeybadger request failed --------------------------------------------- !!
|
9
|
+
|
10
|
+
We encountered an error when contacting the server:
|
11
|
+
|
12
|
+
#{response.error_message}
|
13
|
+
|
14
|
+
To fix this issue, please try the following:
|
15
|
+
|
16
|
+
- Make sure the gem is configured properly.
|
17
|
+
- Retry executing this command a few times.
|
18
|
+
- Make sure you can connect to #{host} (`curl https://#{host}/v1/notices`).
|
19
|
+
- Email support@honeybadger.io for help. Include as much debug info as you
|
20
|
+
can for a faster resolution!
|
21
|
+
|
22
|
+
!! --- End -------------------------------------------------------------------- !!
|
23
|
+
MSG
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -1,50 +1,50 @@
|
|
1
1
|
module Honeybadger
|
2
2
|
module CLI
|
3
3
|
class Heroku < Thor
|
4
|
-
class_option :app, aliases: :
|
4
|
+
class_option :app, aliases: :"-a", type: :string, default: nil, desc: "Specify optional Heroku APP"
|
5
5
|
|
6
|
-
desc
|
7
|
-
option :api_key, aliases: :
|
8
|
-
option :environment, aliases: :
|
6
|
+
desc "install_deploy_notification", "Install Heroku deploy notifications addon"
|
7
|
+
option :api_key, aliases: :"-k", type: :string, desc: "Api key of your Honeybadger application"
|
8
|
+
option :environment, aliases: :"-e", type: :string, desc: 'Environment of your Heroku application (i.e. "production", "staging")'
|
9
9
|
def install_deploy_notification
|
10
|
-
app
|
11
|
-
rails_env = options[
|
12
|
-
api_key
|
10
|
+
app = options.has_key?("app") ? options["app"] : detect_heroku_app(false)
|
11
|
+
rails_env = options["environment"] || heroku_var("RAILS_ENV", app)
|
12
|
+
api_key = options["api_key"] || heroku_var("HONEYBADGER_API_KEY", app)
|
13
13
|
|
14
|
-
unless
|
14
|
+
unless /\S/.match?(api_key)
|
15
15
|
say("Unable to detect your API key from Heroku.", :red)
|
16
|
-
say(
|
16
|
+
say("Have you configured multiple Heroku apps? Try using --app APP", :red) unless app
|
17
17
|
exit(1)
|
18
18
|
end
|
19
19
|
|
20
|
-
unless
|
20
|
+
unless /\S/.match?(rails_env)
|
21
21
|
say("Unable to detect your environment from Heroku. Use --environment ENVIRONMENT.", :red)
|
22
|
-
say(
|
22
|
+
say("Have you configured multiple Heroku apps? Try using --app APP", :red) unless app
|
23
23
|
exit(1)
|
24
24
|
end
|
25
25
|
|
26
|
-
cmd = %
|
26
|
+
cmd = %(heroku webhooks:add -i api:release -l notify -u "https://api.honeybadger.io/v1/deploys/heroku?environment=#{rails_env}&api_key=#{api_key}"#{app ? " --app #{app}" : ""})
|
27
27
|
|
28
28
|
say("Running: `#{cmd}`")
|
29
29
|
say(run(cmd))
|
30
30
|
end
|
31
31
|
|
32
|
-
desc
|
32
|
+
desc "install API_KEY", "Install Honeybadger on Heroku using API_KEY"
|
33
33
|
def install(api_key)
|
34
34
|
say("Installing Honeybadger #{VERSION} for Heroku")
|
35
35
|
|
36
36
|
app = options[:app] || detect_heroku_app(false)
|
37
37
|
say("Adding config HONEYBADGER_API_KEY=#{api_key} to Heroku.", :magenta)
|
38
|
-
unless write_heroku_env({
|
39
|
-
say(
|
38
|
+
unless write_heroku_env({"HONEYBADGER_API_KEY" => api_key}, app)
|
39
|
+
say("Unable to update heroku config. You may need to specify an app name with --app APP", :red)
|
40
40
|
exit(1)
|
41
41
|
end
|
42
42
|
|
43
|
-
if env = heroku_var(
|
44
|
-
say(
|
45
|
-
invoke :install_deploy_notification, [], {
|
43
|
+
if (env = heroku_var("RAILS_ENV", app, heroku_var("RACK_ENV", app)))
|
44
|
+
say("Installing deploy notification addon", :magenta)
|
45
|
+
invoke :install_deploy_notification, [], {app: app, api_key: api_key, environment: env}
|
46
46
|
else
|
47
|
-
say(
|
47
|
+
say("Skipping deploy notification installation: we were unable to determine the environment name from your Heroku app.", :yellow)
|
48
48
|
say("To install manually, try `honeybadger heroku install_deploy_notification#{app ? " -a #{app}" : ""} -k #{api_key} --environment ENVIRONMENT`", :yellow)
|
49
49
|
end
|
50
50
|
|
@@ -60,14 +60,14 @@ module Honeybadger
|
|
60
60
|
#
|
61
61
|
# Returns the String app name if detected, otherwise nil.
|
62
62
|
def detect_heroku_app(prompt_on_default = true)
|
63
|
-
apps, git_config = {}, File.join(Dir.pwd,
|
63
|
+
apps, git_config = {}, File.join(Dir.pwd, ".git", "config")
|
64
64
|
if File.exist?(git_config)
|
65
|
-
require
|
65
|
+
require "inifile"
|
66
66
|
ini = IniFile.load(git_config)
|
67
67
|
ini.each_section do |section|
|
68
|
-
if match = section.match(/remote
|
69
|
-
url = ini[section][
|
70
|
-
if url_match = url.match(/heroku\.com:(?<app>.+)\.git$/)
|
68
|
+
if (match = section.match(/remote "(?<remote>.+)"/))
|
69
|
+
url = ini[section]["url"]
|
70
|
+
if (url_match = url.match(/heroku\.com:(?<app>.+)\.git$/))
|
71
71
|
apps[match[:remote]] = url_match[:app]
|
72
72
|
end
|
73
73
|
end
|
@@ -78,16 +78,16 @@ module Honeybadger
|
|
78
78
|
apps.values.first
|
79
79
|
else
|
80
80
|
say "We detected a Heroku app named #{apps.values.first}. Do you want to load the config? (y/yes or n/no)"
|
81
|
-
if
|
81
|
+
if /(y|yes)/i.match?($stdin.gets.chomp)
|
82
82
|
apps.values.first
|
83
83
|
end
|
84
84
|
end
|
85
85
|
elsif apps.size > 1
|
86
86
|
say "We detected the following Heroku apps:"
|
87
|
-
apps.each_with_index {|a,i| say "\s\s#{i+1}. #{a[1]}" }
|
88
|
-
say "\s\s#{apps.size+1}. Use default"
|
89
|
-
say "Please select an option (1-#{apps.size+1}):"
|
90
|
-
apps.values[
|
87
|
+
apps.each_with_index { |a, i| say "\s\s#{i + 1}. #{a[1]}" }
|
88
|
+
say "\s\s#{apps.size + 1}. Use default"
|
89
|
+
say "Please select an option (1-#{apps.size + 1}):"
|
90
|
+
apps.values[$stdin.gets.chomp.to_i - 1]
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -97,29 +97,29 @@ module Honeybadger
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def heroku_var(var, app_name, default = nil)
|
100
|
-
app = app_name ? "--app #{app_name}" :
|
100
|
+
app = app_name ? "--app #{app_name}" : ""
|
101
101
|
result = run("heroku config:get #{var} #{app} 2> /dev/null").strip
|
102
|
-
result.split.find(lambda { default }) {|x| x =~ /\S/ }
|
102
|
+
result.split.find(lambda { default }) { |x| x =~ /\S/ }
|
103
103
|
end
|
104
104
|
|
105
105
|
def read_heroku_env(app = nil)
|
106
|
-
cmd = [
|
106
|
+
cmd = ["heroku config"]
|
107
107
|
cmd << "--app #{app}" if app
|
108
108
|
output = run(cmd.join("\s"))
|
109
109
|
return false unless $?.to_i == 0
|
110
|
-
|
110
|
+
output.scan(/(HONEYBADGER_[^:]+):\s*(\S.*)\s*$/).to_h
|
111
111
|
end
|
112
112
|
|
113
113
|
def set_env_from_heroku(app = nil)
|
114
|
-
return false unless env = read_heroku_env(app)
|
115
|
-
env.each_pair do |k,v|
|
114
|
+
return false unless (env = read_heroku_env(app))
|
115
|
+
env.each_pair do |k, v|
|
116
116
|
ENV[k] ||= v
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
120
|
def write_heroku_env(env, app = nil)
|
121
121
|
cmd = ["heroku config:set"]
|
122
|
-
Hash(env).each_pair {|k,v| cmd << "#{k}=#{v}" }
|
122
|
+
Hash(env).each_pair { |k, v| cmd << "#{k}=#{v}" }
|
123
123
|
cmd << "--app #{app}" if app
|
124
124
|
run(cmd.join("\s"))
|
125
125
|
$?.to_i == 0
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "forwardable"
|
2
|
+
require "honeybadger/cli/main"
|
3
|
+
require "honeybadger/cli/test"
|
4
|
+
require "pathname"
|
5
5
|
|
6
6
|
module Honeybadger
|
7
7
|
module CLI
|
@@ -18,15 +18,15 @@ module Honeybadger
|
|
18
18
|
say("Installing Honeybadger #{VERSION}")
|
19
19
|
|
20
20
|
begin
|
21
|
-
require File.join(Dir.pwd,
|
21
|
+
require File.join(Dir.pwd, "config", "application.rb")
|
22
22
|
raise LoadError unless defined?(::Rails.application)
|
23
23
|
root = Rails.root
|
24
|
-
config_root = root.join(
|
24
|
+
config_root = root.join("config")
|
25
25
|
rescue LoadError
|
26
26
|
root = config_root = Pathname.new(Dir.pwd)
|
27
27
|
end
|
28
28
|
|
29
|
-
config_path = config_root.join(
|
29
|
+
config_path = config_root.join("honeybadger.yml")
|
30
30
|
|
31
31
|
if config_path.exist?
|
32
32
|
say("You're already on Honeybadger, so you're all set.", :yellow)
|
@@ -45,52 +45,52 @@ module Honeybadger
|
|
45
45
|
|
46
46
|
default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
|
47
47
|
default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
|
48
|
-
File.open(path,
|
49
|
-
file.write(
|
50
|
-
---
|
51
|
-
# For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
|
52
|
-
|
53
|
-
api_key: '#{api_key}'
|
54
|
-
|
55
|
-
# The environment your app is running in.
|
56
|
-
env: "<%= #{default_env} %>"
|
57
|
-
|
58
|
-
# The absolute path to your project folder.
|
59
|
-
root: "<%= #{default_root} %>"
|
60
|
-
|
61
|
-
# Honeybadger won't report errors in these environments.
|
62
|
-
development_environments:
|
63
|
-
- test
|
64
|
-
- development
|
65
|
-
- cucumber
|
66
|
-
|
67
|
-
# By default, Honeybadger won't report errors in the development_environments.
|
68
|
-
# You can override this by explicitly setting report_data to true
|
69
|
-
# report_data: true
|
70
|
-
|
71
|
-
# The current Git revision of your project. Defaults to the last commit hash.
|
72
|
-
# revision: null
|
73
|
-
|
74
|
-
# Enable verbose debug logging (useful for troubleshooting).
|
75
|
-
debug: false
|
76
|
-
|
77
|
-
# Enable Honeybadger Insights
|
78
|
-
insights:
|
79
|
-
|
80
|
-
CONFIG
|
48
|
+
File.open(path, "w+") do |file|
|
49
|
+
file.write(<<~CONFIG)
|
50
|
+
---
|
51
|
+
# For more options, see https://docs.honeybadger.io/lib/ruby/gem-reference/configuration
|
52
|
+
|
53
|
+
api_key: '#{api_key}'
|
54
|
+
|
55
|
+
# The environment your app is running in.
|
56
|
+
env: "<%= #{default_env} %>"
|
57
|
+
|
58
|
+
# The absolute path to your project folder.
|
59
|
+
root: "<%= #{default_root} %>"
|
60
|
+
|
61
|
+
# Honeybadger won't report errors in these environments.
|
62
|
+
development_environments:
|
63
|
+
- test
|
64
|
+
- development
|
65
|
+
- cucumber
|
66
|
+
|
67
|
+
# By default, Honeybadger won't report errors in the development_environments.
|
68
|
+
# You can override this by explicitly setting report_data to true.
|
69
|
+
# report_data: true
|
70
|
+
|
71
|
+
# The current Git revision of your project. Defaults to the last commit hash.
|
72
|
+
# revision: null
|
73
|
+
|
74
|
+
# Enable verbose debug logging (useful for troubleshooting).
|
75
|
+
debug: false
|
76
|
+
|
77
|
+
# Enable Honeybadger Insights
|
78
|
+
insights:
|
79
|
+
enabled: #{options["insights"]}
|
80
|
+
CONFIG
|
81
81
|
if (connection = options.slice("host", "ui_host")).any?
|
82
82
|
file.puts("\n# Override hosts\nconnection:")
|
83
|
-
connection.each {|k,v| file.puts(" #{k}: '#{v}'") }
|
83
|
+
connection.each { |k, v| file.puts(" #{k}: '#{v}'") }
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
if (capfile = root.join(
|
89
|
-
if capfile.read
|
88
|
+
if (capfile = root.join("Capfile")).exist?
|
89
|
+
if /honeybadger/.match?(capfile.read)
|
90
90
|
say("Detected Honeybadger in Capfile; skipping Capistrano installation.", :yellow)
|
91
91
|
else
|
92
92
|
say("Appending Capistrano tasks to: #{capfile}", :yellow)
|
93
|
-
File.open(capfile,
|
93
|
+
File.open(capfile, "a") do |f|
|
94
94
|
f.puts("\nrequire 'capistrano/honeybadger'")
|
95
95
|
end
|
96
96
|
end
|