honeybadger 5.0.2 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +713 -701
- data/LICENSE +19 -19
- data/README.md +57 -57
- data/TROUBLESHOOTING.md +3 -3
- data/bin/honeybadger +5 -5
- data/lib/honeybadger/agent.rb +488 -488
- data/lib/honeybadger/backend/base.rb +116 -116
- data/lib/honeybadger/backend/debug.rb +22 -22
- data/lib/honeybadger/backend/null.rb +29 -29
- data/lib/honeybadger/backend/server.rb +62 -62
- data/lib/honeybadger/backend/test.rb +46 -46
- data/lib/honeybadger/backend.rb +27 -27
- data/lib/honeybadger/backtrace.rb +181 -181
- data/lib/honeybadger/breadcrumbs/active_support.rb +119 -119
- data/lib/honeybadger/breadcrumbs/breadcrumb.rb +53 -53
- data/lib/honeybadger/breadcrumbs/collector.rb +82 -82
- data/lib/honeybadger/breadcrumbs/logging.rb +51 -51
- data/lib/honeybadger/breadcrumbs/ring_buffer.rb +44 -44
- data/lib/honeybadger/breadcrumbs.rb +8 -8
- data/lib/honeybadger/cli/deploy.rb +43 -43
- data/lib/honeybadger/cli/exec.rb +143 -143
- data/lib/honeybadger/cli/helpers.rb +28 -28
- data/lib/honeybadger/cli/heroku.rb +129 -129
- data/lib/honeybadger/cli/install.rb +101 -101
- data/lib/honeybadger/cli/main.rb +237 -237
- data/lib/honeybadger/cli/notify.rb +67 -67
- data/lib/honeybadger/cli/test.rb +267 -267
- data/lib/honeybadger/cli.rb +14 -14
- data/lib/honeybadger/config/defaults.rb +336 -333
- data/lib/honeybadger/config/env.rb +42 -42
- data/lib/honeybadger/config/ruby.rb +146 -146
- data/lib/honeybadger/config/yaml.rb +76 -76
- data/lib/honeybadger/config.rb +413 -413
- data/lib/honeybadger/const.rb +20 -20
- data/lib/honeybadger/context_manager.rb +55 -55
- data/lib/honeybadger/conversions.rb +16 -16
- data/lib/honeybadger/init/rails.rb +38 -38
- data/lib/honeybadger/init/rake.rb +66 -66
- data/lib/honeybadger/init/ruby.rb +11 -11
- data/lib/honeybadger/init/sinatra.rb +51 -51
- data/lib/honeybadger/logging.rb +177 -177
- data/lib/honeybadger/notice.rb +579 -568
- data/lib/honeybadger/plugin.rb +210 -210
- data/lib/honeybadger/plugins/breadcrumbs.rb +111 -111
- data/lib/honeybadger/plugins/delayed_job/plugin.rb +56 -56
- data/lib/honeybadger/plugins/delayed_job.rb +22 -22
- data/lib/honeybadger/plugins/faktory.rb +52 -52
- data/lib/honeybadger/plugins/lambda.rb +71 -71
- data/lib/honeybadger/plugins/local_variables.rb +44 -44
- data/lib/honeybadger/plugins/passenger.rb +23 -23
- data/lib/honeybadger/plugins/rails.rb +72 -63
- data/lib/honeybadger/plugins/resque.rb +72 -72
- data/lib/honeybadger/plugins/shoryuken.rb +52 -52
- data/lib/honeybadger/plugins/sidekiq.rb +71 -62
- data/lib/honeybadger/plugins/sucker_punch.rb +18 -18
- data/lib/honeybadger/plugins/thor.rb +32 -32
- data/lib/honeybadger/plugins/warden.rb +19 -19
- data/lib/honeybadger/rack/error_notifier.rb +92 -92
- data/lib/honeybadger/rack/user_feedback.rb +88 -88
- data/lib/honeybadger/rack/user_informer.rb +45 -45
- data/lib/honeybadger/ruby.rb +2 -2
- data/lib/honeybadger/singleton.rb +103 -103
- data/lib/honeybadger/tasks.rb +22 -22
- data/lib/honeybadger/templates/feedback_form.erb +84 -84
- data/lib/honeybadger/util/http.rb +92 -92
- data/lib/honeybadger/util/lambda.rb +32 -32
- data/lib/honeybadger/util/request_hash.rb +73 -73
- data/lib/honeybadger/util/request_payload.rb +41 -41
- data/lib/honeybadger/util/revision.rb +39 -39
- data/lib/honeybadger/util/sanitizer.rb +214 -214
- data/lib/honeybadger/util/sql.rb +34 -34
- data/lib/honeybadger/util/stats.rb +50 -50
- data/lib/honeybadger/version.rb +4 -4
- data/lib/honeybadger/worker.rb +253 -253
- data/lib/honeybadger.rb +11 -11
- data/resources/ca-bundle.crt +3376 -3376
- data/vendor/capistrano-honeybadger/lib/capistrano/honeybadger.rb +5 -5
- data/vendor/capistrano-honeybadger/lib/capistrano/tasks/deploy.cap +89 -89
- data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano/legacy.rb +47 -47
- data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano.rb +2 -2
- data/vendor/cli/inifile.rb +628 -628
- data/vendor/cli/thor/actions/create_file.rb +103 -103
- data/vendor/cli/thor/actions/create_link.rb +59 -59
- data/vendor/cli/thor/actions/directory.rb +118 -118
- data/vendor/cli/thor/actions/empty_directory.rb +135 -135
- data/vendor/cli/thor/actions/file_manipulation.rb +316 -316
- data/vendor/cli/thor/actions/inject_into_file.rb +107 -107
- data/vendor/cli/thor/actions.rb +319 -319
- data/vendor/cli/thor/base.rb +656 -656
- data/vendor/cli/thor/command.rb +133 -133
- data/vendor/cli/thor/core_ext/hash_with_indifferent_access.rb +77 -77
- data/vendor/cli/thor/core_ext/io_binary_read.rb +10 -10
- data/vendor/cli/thor/core_ext/ordered_hash.rb +98 -98
- data/vendor/cli/thor/error.rb +32 -32
- data/vendor/cli/thor/group.rb +281 -281
- data/vendor/cli/thor/invocation.rb +178 -178
- data/vendor/cli/thor/line_editor/basic.rb +35 -35
- data/vendor/cli/thor/line_editor/readline.rb +88 -88
- data/vendor/cli/thor/line_editor.rb +17 -17
- data/vendor/cli/thor/parser/argument.rb +73 -73
- data/vendor/cli/thor/parser/arguments.rb +175 -175
- data/vendor/cli/thor/parser/option.rb +125 -125
- data/vendor/cli/thor/parser/options.rb +218 -218
- data/vendor/cli/thor/parser.rb +4 -4
- data/vendor/cli/thor/rake_compat.rb +71 -71
- data/vendor/cli/thor/runner.rb +322 -322
- data/vendor/cli/thor/shell/basic.rb +421 -421
- data/vendor/cli/thor/shell/color.rb +149 -149
- data/vendor/cli/thor/shell/html.rb +126 -126
- data/vendor/cli/thor/shell.rb +81 -81
- data/vendor/cli/thor/util.rb +267 -267
- data/vendor/cli/thor/version.rb +3 -3
- data/vendor/cli/thor.rb +484 -484
- metadata +10 -5
@@ -1,101 +1,101 @@
|
|
1
|
-
require 'forwardable'
|
2
|
-
require 'honeybadger/cli/main'
|
3
|
-
require 'honeybadger/cli/test'
|
4
|
-
require 'pathname'
|
5
|
-
|
6
|
-
module Honeybadger
|
7
|
-
module CLI
|
8
|
-
class Install
|
9
|
-
extend Forwardable
|
10
|
-
|
11
|
-
def initialize(options, api_key)
|
12
|
-
@options = options
|
13
|
-
@api_key = api_key
|
14
|
-
@shell = ::Thor::Base.shell.new
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
say("Installing Honeybadger #{VERSION}")
|
19
|
-
|
20
|
-
begin
|
21
|
-
require File.join(Dir.pwd, 'config', 'application.rb')
|
22
|
-
raise LoadError unless defined?(::Rails.application)
|
23
|
-
root = Rails.root
|
24
|
-
config_root = root.join('config')
|
25
|
-
rescue LoadError
|
26
|
-
root = config_root = Pathname.new(Dir.pwd)
|
27
|
-
end
|
28
|
-
|
29
|
-
config_path = config_root.join('honeybadger.yml')
|
30
|
-
|
31
|
-
if config_path.exist?
|
32
|
-
say("You're already on Honeybadger, so you're all set.", :yellow)
|
33
|
-
else
|
34
|
-
say("Writing configuration to: #{config_path}", :yellow)
|
35
|
-
|
36
|
-
path = config_path
|
37
|
-
|
38
|
-
if path.exist?
|
39
|
-
say("The configuration file #{config_path} already exists.", :red)
|
40
|
-
exit(1)
|
41
|
-
elsif !path.dirname.writable?
|
42
|
-
say("The configuration path #{config_path.dirname} is not writable.", :red)
|
43
|
-
exit(1)
|
44
|
-
end
|
45
|
-
|
46
|
-
default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
|
47
|
-
default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
|
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 or false.
|
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
|
-
CONFIG
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
if (capfile = root.join('Capfile')).exist?
|
81
|
-
if capfile.read.match(/honeybadger/)
|
82
|
-
say("Detected Honeybadger in Capfile; skipping Capistrano installation.", :yellow)
|
83
|
-
else
|
84
|
-
say("Appending Capistrano tasks to: #{capfile}", :yellow)
|
85
|
-
File.open(capfile, 'a') do |f|
|
86
|
-
f.puts("\nrequire 'capistrano/honeybadger'")
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
Test.new({install: true}.freeze).run
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
attr_reader :options, :api_key
|
97
|
-
|
98
|
-
def_delegator :@shell, :say
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
1
|
+
require 'forwardable'
|
2
|
+
require 'honeybadger/cli/main'
|
3
|
+
require 'honeybadger/cli/test'
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
module Honeybadger
|
7
|
+
module CLI
|
8
|
+
class Install
|
9
|
+
extend Forwardable
|
10
|
+
|
11
|
+
def initialize(options, api_key)
|
12
|
+
@options = options
|
13
|
+
@api_key = api_key
|
14
|
+
@shell = ::Thor::Base.shell.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
say("Installing Honeybadger #{VERSION}")
|
19
|
+
|
20
|
+
begin
|
21
|
+
require File.join(Dir.pwd, 'config', 'application.rb')
|
22
|
+
raise LoadError unless defined?(::Rails.application)
|
23
|
+
root = Rails.root
|
24
|
+
config_root = root.join('config')
|
25
|
+
rescue LoadError
|
26
|
+
root = config_root = Pathname.new(Dir.pwd)
|
27
|
+
end
|
28
|
+
|
29
|
+
config_path = config_root.join('honeybadger.yml')
|
30
|
+
|
31
|
+
if config_path.exist?
|
32
|
+
say("You're already on Honeybadger, so you're all set.", :yellow)
|
33
|
+
else
|
34
|
+
say("Writing configuration to: #{config_path}", :yellow)
|
35
|
+
|
36
|
+
path = config_path
|
37
|
+
|
38
|
+
if path.exist?
|
39
|
+
say("The configuration file #{config_path} already exists.", :red)
|
40
|
+
exit(1)
|
41
|
+
elsif !path.dirname.writable?
|
42
|
+
say("The configuration path #{config_path.dirname} is not writable.", :red)
|
43
|
+
exit(1)
|
44
|
+
end
|
45
|
+
|
46
|
+
default_env = defined?(::Rails.application) ? "Rails.env" : "ENV['RUBY_ENV'] || ENV['RACK_ENV']"
|
47
|
+
default_root = defined?(::Rails.application) ? "Rails.root.to_s" : "Dir.pwd"
|
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 or false.
|
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
|
+
CONFIG
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
if (capfile = root.join('Capfile')).exist?
|
81
|
+
if capfile.read.match(/honeybadger/)
|
82
|
+
say("Detected Honeybadger in Capfile; skipping Capistrano installation.", :yellow)
|
83
|
+
else
|
84
|
+
say("Appending Capistrano tasks to: #{capfile}", :yellow)
|
85
|
+
File.open(capfile, 'a') do |f|
|
86
|
+
f.puts("\nrequire 'capistrano/honeybadger'")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
Test.new({install: true}.freeze).run
|
92
|
+
end
|
93
|
+
|
94
|
+
private
|
95
|
+
|
96
|
+
attr_reader :options, :api_key
|
97
|
+
|
98
|
+
def_delegator :@shell, :say
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|