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,135 +1,135 @@
|
|
1
|
-
class Thor
|
2
|
-
module Actions
|
3
|
-
# Creates an empty directory.
|
4
|
-
#
|
5
|
-
# ==== Parameters
|
6
|
-
# destination<String>:: the relative path to the destination root.
|
7
|
-
# config<Hash>:: give :verbose => false to not log the status.
|
8
|
-
#
|
9
|
-
# ==== Examples
|
10
|
-
#
|
11
|
-
# empty_directory "doc"
|
12
|
-
#
|
13
|
-
def empty_directory(destination, config = {})
|
14
|
-
action EmptyDirectory.new(self, destination, config)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Class which holds create directory logic. This is the base class for
|
18
|
-
# other actions like create_file and directory.
|
19
|
-
#
|
20
|
-
# This implementation is based in Templater actions, created by Jonas Nicklas
|
21
|
-
# and Michael S. Klishin under MIT LICENSE.
|
22
|
-
#
|
23
|
-
class EmptyDirectory #:nodoc:
|
24
|
-
attr_reader :base, :destination, :given_destination, :relative_destination, :config
|
25
|
-
|
26
|
-
# Initializes given the source and destination.
|
27
|
-
#
|
28
|
-
# ==== Parameters
|
29
|
-
# base<Thor::Base>:: A Thor::Base instance
|
30
|
-
# source<String>:: Relative path to the source of this file
|
31
|
-
# destination<String>:: Relative path to the destination of this file
|
32
|
-
# config<Hash>:: give :verbose => false to not log the status.
|
33
|
-
#
|
34
|
-
def initialize(base, destination, config = {})
|
35
|
-
@base, @config = base, {:verbose => true}.merge(config)
|
36
|
-
self.destination = destination
|
37
|
-
end
|
38
|
-
|
39
|
-
# Checks if the destination file already exists.
|
40
|
-
#
|
41
|
-
# ==== Returns
|
42
|
-
# Boolean:: true if the file exists, false otherwise.
|
43
|
-
#
|
44
|
-
def exists?
|
45
|
-
::File.exist?(destination)
|
46
|
-
end
|
47
|
-
|
48
|
-
def invoke!
|
49
|
-
invoke_with_conflict_check do
|
50
|
-
::FileUtils.mkdir_p(destination)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def revoke!
|
55
|
-
say_status :remove, :red
|
56
|
-
::FileUtils.rm_rf(destination) if !pretend? && exists?
|
57
|
-
given_destination
|
58
|
-
end
|
59
|
-
|
60
|
-
protected
|
61
|
-
|
62
|
-
# Shortcut for pretend.
|
63
|
-
#
|
64
|
-
def pretend?
|
65
|
-
base.options[:pretend]
|
66
|
-
end
|
67
|
-
|
68
|
-
# Sets the absolute destination value from a relative destination value.
|
69
|
-
# It also stores the given and relative destination. Let's suppose our
|
70
|
-
# script is being executed on "dest", it sets the destination root to
|
71
|
-
# "dest". The destination, given_destination and relative_destination
|
72
|
-
# are related in the following way:
|
73
|
-
#
|
74
|
-
# inside "bar" do
|
75
|
-
# empty_directory "baz"
|
76
|
-
# end
|
77
|
-
#
|
78
|
-
# destination #=> dest/bar/baz
|
79
|
-
# relative_destination #=> bar/baz
|
80
|
-
# given_destination #=> baz
|
81
|
-
#
|
82
|
-
def destination=(destination)
|
83
|
-
if destination
|
84
|
-
@given_destination = convert_encoded_instructions(destination.to_s)
|
85
|
-
@destination = ::File.expand_path(@given_destination, base.destination_root)
|
86
|
-
@relative_destination = base.relative_to_original_destination_root(@destination)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# Filenames in the encoded form are converted. If you have a file:
|
91
|
-
#
|
92
|
-
# %file_name%.rb
|
93
|
-
#
|
94
|
-
# It calls #file_name from the base and replaces %-string with the
|
95
|
-
# return value (should be String) of #file_name:
|
96
|
-
#
|
97
|
-
# user.rb
|
98
|
-
#
|
99
|
-
# The method referenced can be either public or private.
|
100
|
-
#
|
101
|
-
def convert_encoded_instructions(filename)
|
102
|
-
filename.gsub(/%(.*?)%/) do |initial_string|
|
103
|
-
method = $1.strip
|
104
|
-
base.respond_to?(method, true) ? base.send(method) : initial_string
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# Receives a hash of options and just execute the block if some
|
109
|
-
# conditions are met.
|
110
|
-
#
|
111
|
-
def invoke_with_conflict_check(&block)
|
112
|
-
if exists?
|
113
|
-
on_conflict_behavior(&block)
|
114
|
-
else
|
115
|
-
say_status :create, :green
|
116
|
-
block.call unless pretend?
|
117
|
-
end
|
118
|
-
|
119
|
-
destination
|
120
|
-
end
|
121
|
-
|
122
|
-
# What to do when the destination file already exists.
|
123
|
-
#
|
124
|
-
def on_conflict_behavior(&block)
|
125
|
-
say_status :exist, :blue
|
126
|
-
end
|
127
|
-
|
128
|
-
# Shortcut to say_status shell method.
|
129
|
-
#
|
130
|
-
def say_status(status, color)
|
131
|
-
base.shell.say_status status, relative_destination, color if config[:verbose]
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
1
|
+
class Thor
|
2
|
+
module Actions
|
3
|
+
# Creates an empty directory.
|
4
|
+
#
|
5
|
+
# ==== Parameters
|
6
|
+
# destination<String>:: the relative path to the destination root.
|
7
|
+
# config<Hash>:: give :verbose => false to not log the status.
|
8
|
+
#
|
9
|
+
# ==== Examples
|
10
|
+
#
|
11
|
+
# empty_directory "doc"
|
12
|
+
#
|
13
|
+
def empty_directory(destination, config = {})
|
14
|
+
action EmptyDirectory.new(self, destination, config)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Class which holds create directory logic. This is the base class for
|
18
|
+
# other actions like create_file and directory.
|
19
|
+
#
|
20
|
+
# This implementation is based in Templater actions, created by Jonas Nicklas
|
21
|
+
# and Michael S. Klishin under MIT LICENSE.
|
22
|
+
#
|
23
|
+
class EmptyDirectory #:nodoc:
|
24
|
+
attr_reader :base, :destination, :given_destination, :relative_destination, :config
|
25
|
+
|
26
|
+
# Initializes given the source and destination.
|
27
|
+
#
|
28
|
+
# ==== Parameters
|
29
|
+
# base<Thor::Base>:: A Thor::Base instance
|
30
|
+
# source<String>:: Relative path to the source of this file
|
31
|
+
# destination<String>:: Relative path to the destination of this file
|
32
|
+
# config<Hash>:: give :verbose => false to not log the status.
|
33
|
+
#
|
34
|
+
def initialize(base, destination, config = {})
|
35
|
+
@base, @config = base, {:verbose => true}.merge(config)
|
36
|
+
self.destination = destination
|
37
|
+
end
|
38
|
+
|
39
|
+
# Checks if the destination file already exists.
|
40
|
+
#
|
41
|
+
# ==== Returns
|
42
|
+
# Boolean:: true if the file exists, false otherwise.
|
43
|
+
#
|
44
|
+
def exists?
|
45
|
+
::File.exist?(destination)
|
46
|
+
end
|
47
|
+
|
48
|
+
def invoke!
|
49
|
+
invoke_with_conflict_check do
|
50
|
+
::FileUtils.mkdir_p(destination)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def revoke!
|
55
|
+
say_status :remove, :red
|
56
|
+
::FileUtils.rm_rf(destination) if !pretend? && exists?
|
57
|
+
given_destination
|
58
|
+
end
|
59
|
+
|
60
|
+
protected
|
61
|
+
|
62
|
+
# Shortcut for pretend.
|
63
|
+
#
|
64
|
+
def pretend?
|
65
|
+
base.options[:pretend]
|
66
|
+
end
|
67
|
+
|
68
|
+
# Sets the absolute destination value from a relative destination value.
|
69
|
+
# It also stores the given and relative destination. Let's suppose our
|
70
|
+
# script is being executed on "dest", it sets the destination root to
|
71
|
+
# "dest". The destination, given_destination and relative_destination
|
72
|
+
# are related in the following way:
|
73
|
+
#
|
74
|
+
# inside "bar" do
|
75
|
+
# empty_directory "baz"
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# destination #=> dest/bar/baz
|
79
|
+
# relative_destination #=> bar/baz
|
80
|
+
# given_destination #=> baz
|
81
|
+
#
|
82
|
+
def destination=(destination)
|
83
|
+
if destination
|
84
|
+
@given_destination = convert_encoded_instructions(destination.to_s)
|
85
|
+
@destination = ::File.expand_path(@given_destination, base.destination_root)
|
86
|
+
@relative_destination = base.relative_to_original_destination_root(@destination)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Filenames in the encoded form are converted. If you have a file:
|
91
|
+
#
|
92
|
+
# %file_name%.rb
|
93
|
+
#
|
94
|
+
# It calls #file_name from the base and replaces %-string with the
|
95
|
+
# return value (should be String) of #file_name:
|
96
|
+
#
|
97
|
+
# user.rb
|
98
|
+
#
|
99
|
+
# The method referenced can be either public or private.
|
100
|
+
#
|
101
|
+
def convert_encoded_instructions(filename)
|
102
|
+
filename.gsub(/%(.*?)%/) do |initial_string|
|
103
|
+
method = $1.strip
|
104
|
+
base.respond_to?(method, true) ? base.send(method) : initial_string
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Receives a hash of options and just execute the block if some
|
109
|
+
# conditions are met.
|
110
|
+
#
|
111
|
+
def invoke_with_conflict_check(&block)
|
112
|
+
if exists?
|
113
|
+
on_conflict_behavior(&block)
|
114
|
+
else
|
115
|
+
say_status :create, :green
|
116
|
+
block.call unless pretend?
|
117
|
+
end
|
118
|
+
|
119
|
+
destination
|
120
|
+
end
|
121
|
+
|
122
|
+
# What to do when the destination file already exists.
|
123
|
+
#
|
124
|
+
def on_conflict_behavior(&block)
|
125
|
+
say_status :exist, :blue
|
126
|
+
end
|
127
|
+
|
128
|
+
# Shortcut to say_status shell method.
|
129
|
+
#
|
130
|
+
def say_status(status, color)
|
131
|
+
base.shell.say_status status, relative_destination, color if config[:verbose]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|