honeybadger 4.12.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 -673
- 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 -481
- 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 -45
- 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 -327
- 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 -35
- 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 -48
- 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,107 +1,107 @@
|
|
1
|
-
require "thor/actions/empty_directory"
|
2
|
-
|
3
|
-
class Thor
|
4
|
-
module Actions
|
5
|
-
# Injects the given content into a file. Different from gsub_file, this
|
6
|
-
# method is reversible.
|
7
|
-
#
|
8
|
-
# ==== Parameters
|
9
|
-
# destination<String>:: Relative path to the destination root
|
10
|
-
# data<String>:: Data to add to the file. Can be given as a block.
|
11
|
-
# config<Hash>:: give :verbose => false to not log the status and the flag
|
12
|
-
# for injection (:after or :before) or :force => true for
|
13
|
-
# insert two or more times the same content.
|
14
|
-
#
|
15
|
-
# ==== Examples
|
16
|
-
#
|
17
|
-
# insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
|
18
|
-
#
|
19
|
-
# insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
|
20
|
-
# gems = ask "Which gems would you like to add?"
|
21
|
-
# gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
def insert_into_file(destination, *args, &block)
|
25
|
-
if block_given?
|
26
|
-
data, config = block, args.shift
|
27
|
-
else
|
28
|
-
data, config = args.shift, args.shift
|
29
|
-
end
|
30
|
-
action InjectIntoFile.new(self, destination, data, config)
|
31
|
-
end
|
32
|
-
alias_method :inject_into_file, :insert_into_file
|
33
|
-
|
34
|
-
class InjectIntoFile < EmptyDirectory #:nodoc:
|
35
|
-
attr_reader :replacement, :flag, :behavior
|
36
|
-
|
37
|
-
def initialize(base, destination, data, config)
|
38
|
-
super(base, destination, {:verbose => true}.merge(config))
|
39
|
-
|
40
|
-
@behavior, @flag = if @config.key?(:after)
|
41
|
-
[:after, @config.delete(:after)]
|
42
|
-
else
|
43
|
-
[:before, @config.delete(:before)]
|
44
|
-
end
|
45
|
-
|
46
|
-
@replacement = data.is_a?(Proc) ? data.call : data
|
47
|
-
@flag = Regexp.escape(@flag) unless @flag.is_a?(Regexp)
|
48
|
-
end
|
49
|
-
|
50
|
-
def invoke!
|
51
|
-
say_status :invoke
|
52
|
-
|
53
|
-
content = if @behavior == :after
|
54
|
-
'\0' + replacement
|
55
|
-
else
|
56
|
-
replacement + '\0'
|
57
|
-
end
|
58
|
-
|
59
|
-
replace!(/#{flag}/, content, config[:force])
|
60
|
-
end
|
61
|
-
|
62
|
-
def revoke!
|
63
|
-
say_status :revoke
|
64
|
-
|
65
|
-
regexp = if @behavior == :after
|
66
|
-
content = '\1\2'
|
67
|
-
/(#{flag})(.*)(#{Regexp.escape(replacement)})/m
|
68
|
-
else
|
69
|
-
content = '\2\3'
|
70
|
-
/(#{Regexp.escape(replacement)})(.*)(#{flag})/m
|
71
|
-
end
|
72
|
-
|
73
|
-
replace!(regexp, content, true)
|
74
|
-
end
|
75
|
-
|
76
|
-
protected
|
77
|
-
|
78
|
-
def say_status(behavior)
|
79
|
-
status = if behavior == :invoke
|
80
|
-
if flag == /\A/
|
81
|
-
:prepend
|
82
|
-
elsif flag == /\z/
|
83
|
-
:append
|
84
|
-
else
|
85
|
-
:insert
|
86
|
-
end
|
87
|
-
else
|
88
|
-
:subtract
|
89
|
-
end
|
90
|
-
|
91
|
-
super(status, config[:verbose])
|
92
|
-
end
|
93
|
-
|
94
|
-
# Adds the content to the file.
|
95
|
-
#
|
96
|
-
def replace!(regexp, string, force)
|
97
|
-
unless base.options[:pretend]
|
98
|
-
content = File.binread(destination)
|
99
|
-
if force || !content.include?(replacement)
|
100
|
-
content.gsub!(regexp, string)
|
101
|
-
File.open(destination, "wb") { |file| file.write(content) }
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
1
|
+
require "thor/actions/empty_directory"
|
2
|
+
|
3
|
+
class Thor
|
4
|
+
module Actions
|
5
|
+
# Injects the given content into a file. Different from gsub_file, this
|
6
|
+
# method is reversible.
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# destination<String>:: Relative path to the destination root
|
10
|
+
# data<String>:: Data to add to the file. Can be given as a block.
|
11
|
+
# config<Hash>:: give :verbose => false to not log the status and the flag
|
12
|
+
# for injection (:after or :before) or :force => true for
|
13
|
+
# insert two or more times the same content.
|
14
|
+
#
|
15
|
+
# ==== Examples
|
16
|
+
#
|
17
|
+
# insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
|
18
|
+
#
|
19
|
+
# insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
|
20
|
+
# gems = ask "Which gems would you like to add?"
|
21
|
+
# gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
def insert_into_file(destination, *args, &block)
|
25
|
+
if block_given?
|
26
|
+
data, config = block, args.shift
|
27
|
+
else
|
28
|
+
data, config = args.shift, args.shift
|
29
|
+
end
|
30
|
+
action InjectIntoFile.new(self, destination, data, config)
|
31
|
+
end
|
32
|
+
alias_method :inject_into_file, :insert_into_file
|
33
|
+
|
34
|
+
class InjectIntoFile < EmptyDirectory #:nodoc:
|
35
|
+
attr_reader :replacement, :flag, :behavior
|
36
|
+
|
37
|
+
def initialize(base, destination, data, config)
|
38
|
+
super(base, destination, {:verbose => true}.merge(config))
|
39
|
+
|
40
|
+
@behavior, @flag = if @config.key?(:after)
|
41
|
+
[:after, @config.delete(:after)]
|
42
|
+
else
|
43
|
+
[:before, @config.delete(:before)]
|
44
|
+
end
|
45
|
+
|
46
|
+
@replacement = data.is_a?(Proc) ? data.call : data
|
47
|
+
@flag = Regexp.escape(@flag) unless @flag.is_a?(Regexp)
|
48
|
+
end
|
49
|
+
|
50
|
+
def invoke!
|
51
|
+
say_status :invoke
|
52
|
+
|
53
|
+
content = if @behavior == :after
|
54
|
+
'\0' + replacement
|
55
|
+
else
|
56
|
+
replacement + '\0'
|
57
|
+
end
|
58
|
+
|
59
|
+
replace!(/#{flag}/, content, config[:force])
|
60
|
+
end
|
61
|
+
|
62
|
+
def revoke!
|
63
|
+
say_status :revoke
|
64
|
+
|
65
|
+
regexp = if @behavior == :after
|
66
|
+
content = '\1\2'
|
67
|
+
/(#{flag})(.*)(#{Regexp.escape(replacement)})/m
|
68
|
+
else
|
69
|
+
content = '\2\3'
|
70
|
+
/(#{Regexp.escape(replacement)})(.*)(#{flag})/m
|
71
|
+
end
|
72
|
+
|
73
|
+
replace!(regexp, content, true)
|
74
|
+
end
|
75
|
+
|
76
|
+
protected
|
77
|
+
|
78
|
+
def say_status(behavior)
|
79
|
+
status = if behavior == :invoke
|
80
|
+
if flag == /\A/
|
81
|
+
:prepend
|
82
|
+
elsif flag == /\z/
|
83
|
+
:append
|
84
|
+
else
|
85
|
+
:insert
|
86
|
+
end
|
87
|
+
else
|
88
|
+
:subtract
|
89
|
+
end
|
90
|
+
|
91
|
+
super(status, config[:verbose])
|
92
|
+
end
|
93
|
+
|
94
|
+
# Adds the content to the file.
|
95
|
+
#
|
96
|
+
def replace!(regexp, string, force)
|
97
|
+
unless base.options[:pretend]
|
98
|
+
content = File.binread(destination)
|
99
|
+
if force || !content.include?(replacement)
|
100
|
+
content.gsub!(regexp, string)
|
101
|
+
File.open(destination, "wb") { |file| file.write(content) }
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|