honeybadger 1.12.0.beta3 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/Appraisals +45 -60
  2. data/CHANGELOG.md +3 -28
  3. data/Gemfile.lock +1 -1
  4. data/MIT-LICENSE +1 -2
  5. data/Rakefile +4 -8
  6. data/features/step_definitions/rack_steps.rb +2 -1
  7. data/features/support/env.rb +0 -2
  8. data/gemfiles/rack.gemfile.lock +125 -0
  9. data/gemfiles/rails2.3.gemfile.lock +141 -0
  10. data/gemfiles/rails3.0.gemfile.lock +193 -0
  11. data/gemfiles/rails3.1.gemfile.lock +203 -0
  12. data/gemfiles/rails3.2.gemfile.lock +201 -0
  13. data/gemfiles/rails4.0.gemfile.lock +197 -0
  14. data/gemfiles/rails4.1.gemfile.lock +202 -0
  15. data/gemfiles/rake.gemfile +1 -1
  16. data/gemfiles/rake.gemfile.lock +124 -0
  17. data/gemfiles/sinatra.gemfile.lock +124 -0
  18. data/honeybadger.gemspec +11 -27
  19. data/lib/honeybadger.rb +10 -15
  20. data/lib/honeybadger/configuration.rb +4 -9
  21. data/lib/honeybadger/integrations/sidekiq.rb +9 -17
  22. data/lib/honeybadger/notice.rb +10 -45
  23. data/lib/honeybadger/rack.rb +54 -8
  24. data/lib/honeybadger/rails.rb +4 -5
  25. data/lib/honeybadger/railtie.rb +3 -4
  26. data/lib/honeybadger/user_feedback.rb +67 -3
  27. data/lib/honeybadger/user_informer.rb +21 -3
  28. data/spec/honeybadger/configuration_spec.rb +1 -5
  29. data/spec/honeybadger/notice_spec.rb +1 -126
  30. data/spec/honeybadger/rails_spec.rb +2 -4
  31. metadata +15 -31
  32. data/features/standalone.feature +0 -73
  33. data/features/step_definitions/standalone_steps.rb +0 -12
  34. data/features/step_definitions/thor_steps.rb +0 -4
  35. data/features/support/test.thor +0 -22
  36. data/features/thor.feature +0 -5
  37. data/gemfiles/binding_of_caller.gemfile +0 -8
  38. data/gemfiles/rails.gemfile +0 -11
  39. data/gemfiles/standalone.gemfile +0 -7
  40. data/gemfiles/thor.gemfile +0 -8
  41. data/lib/honeybadger/dependency.rb +0 -65
  42. data/lib/honeybadger/exception_extensions.rb +0 -35
  43. data/lib/honeybadger/integrations.rb +0 -5
  44. data/lib/honeybadger/integrations/delayed_job.rb +0 -20
  45. data/lib/honeybadger/integrations/delayed_job/plugin.rb +0 -31
  46. data/lib/honeybadger/integrations/thor.rb +0 -29
  47. data/lib/honeybadger/payload.rb +0 -29
  48. data/lib/honeybadger/rack/error_notifier.rb +0 -60
  49. data/lib/honeybadger/rack/user_feedback.rb +0 -74
  50. data/lib/honeybadger/rack/user_informer.rb +0 -28
  51. data/spec/honeybadger/dependency_spec.rb +0 -134
  52. data/spec/honeybadger/exception_extensions_spec.rb +0 -40
  53. data/spec/honeybadger/integrations/delayed_job_spec.rb +0 -48
  54. data/spec/honeybadger/integrations/sidekiq_spec.rb +0 -60
  55. data/spec/honeybadger/integrations/thor_spec.rb +0 -29
  56. data/spec/honeybadger/payload_spec.rb +0 -27
@@ -0,0 +1,124 @@
1
+ PATH
2
+ remote: /Users/josh/code/honeybadger-ruby
3
+ specs:
4
+ honeybadger (1.13.0)
5
+ json
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.3.5)
11
+ appraisal (0.5.2)
12
+ bundler
13
+ rake
14
+ aruba (0.5.4)
15
+ childprocess (>= 0.3.6)
16
+ cucumber (>= 1.1.1)
17
+ rspec-expectations (>= 2.7.0)
18
+ builder (3.2.2)
19
+ capistrano (2.15.5)
20
+ highline
21
+ net-scp (>= 1.0.0)
22
+ net-sftp (>= 2.0.0)
23
+ net-ssh (>= 2.0.14)
24
+ net-ssh-gateway (>= 1.1.0)
25
+ childprocess (0.4.0)
26
+ ffi (~> 1.0, >= 1.0.11)
27
+ coderay (1.1.0)
28
+ crack (0.4.1)
29
+ safe_yaml (~> 0.9.0)
30
+ cucumber (1.3.10)
31
+ builder (>= 2.1.2)
32
+ diff-lcs (>= 1.1.3)
33
+ gherkin (~> 2.12)
34
+ multi_json (>= 1.7.5, < 2.0)
35
+ multi_test (>= 0.0.2)
36
+ diff-lcs (1.2.5)
37
+ ffi (1.9.3)
38
+ formatador (0.2.4)
39
+ fuubar (1.3.2)
40
+ rspec (>= 2.14.0, < 3.1.0)
41
+ ruby-progressbar (~> 1.3)
42
+ gherkin (2.12.2)
43
+ multi_json (~> 1.3)
44
+ growl (1.0.3)
45
+ guard (1.8.3)
46
+ formatador (>= 0.2.4)
47
+ listen (~> 1.3)
48
+ lumberjack (>= 1.0.2)
49
+ pry (>= 0.9.10)
50
+ thor (>= 0.14.6)
51
+ guard-rspec (3.1.0)
52
+ guard (>= 1.8)
53
+ rspec (~> 2.13)
54
+ highline (1.6.20)
55
+ json (1.8.1)
56
+ listen (1.3.1)
57
+ rb-fsevent (>= 0.9.3)
58
+ rb-inotify (>= 0.9)
59
+ rb-kqueue (>= 0.2)
60
+ lumberjack (1.0.4)
61
+ method_source (0.8.2)
62
+ multi_json (1.8.4)
63
+ multi_test (0.0.3)
64
+ net-scp (1.1.2)
65
+ net-ssh (>= 2.6.5)
66
+ net-sftp (2.1.2)
67
+ net-ssh (>= 2.6.5)
68
+ net-ssh (2.7.0)
69
+ net-ssh-gateway (1.2.0)
70
+ net-ssh (>= 2.6.5)
71
+ pry (0.9.12.4)
72
+ coderay (~> 1.0)
73
+ method_source (~> 0.8)
74
+ slop (~> 3.4)
75
+ rack (1.5.2)
76
+ rack-protection (1.5.2)
77
+ rack
78
+ rake (10.1.1)
79
+ rb-fsevent (0.9.4)
80
+ rb-inotify (0.9.3)
81
+ ffi (>= 0.5.0)
82
+ rb-kqueue (0.2.0)
83
+ ffi (>= 0.5.0)
84
+ rspec (2.14.1)
85
+ rspec-core (~> 2.14.0)
86
+ rspec-expectations (~> 2.14.0)
87
+ rspec-mocks (~> 2.14.0)
88
+ rspec-core (2.14.7)
89
+ rspec-expectations (2.14.4)
90
+ diff-lcs (>= 1.1.3, < 2.0)
91
+ rspec-mocks (2.14.4)
92
+ ruby-progressbar (1.4.0)
93
+ safe_yaml (0.9.7)
94
+ sham_rack (1.3.6)
95
+ rack
96
+ sinatra (1.4.4)
97
+ rack (~> 1.4)
98
+ rack-protection (~> 1.4)
99
+ tilt (~> 1.3, >= 1.3.4)
100
+ slop (3.4.7)
101
+ thor (0.18.1)
102
+ tilt (1.4.1)
103
+ webmock (1.17.1)
104
+ addressable (>= 2.2.7)
105
+ crack (>= 0.3.2)
106
+
107
+ PLATFORMS
108
+ ruby
109
+
110
+ DEPENDENCIES
111
+ appraisal
112
+ aruba
113
+ capistrano (~> 2.0)
114
+ cucumber (~> 1.3.10)
115
+ fuubar
116
+ growl
117
+ guard (~> 1.8.3)
118
+ guard-rspec
119
+ honeybadger!
120
+ rake
121
+ rspec (~> 2.14.0)
122
+ sham_rack (~> 1.3.0)
123
+ sinatra
124
+ webmock
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'honeybadger'
7
- s.version = '1.12.0.beta3'
8
- s.date = '2014-04-08'
7
+ s.version = '1.13.0'
8
+ s.date = '2014-04-23'
9
9
 
10
10
  s.summary = 'Error reports you can be happy about.'
11
11
  s.description = 'Make managing application errors a more pleasant experience.'
@@ -53,33 +53,33 @@ Gem::Specification.new do |s|
53
53
  features/rails.feature
54
54
  features/rake.feature
55
55
  features/sinatra.feature
56
- features/standalone.feature
57
56
  features/step_definitions/metal_steps.rb
58
57
  features/step_definitions/rack_steps.rb
59
58
  features/step_definitions/rails_steps.rb
60
59
  features/step_definitions/rake_steps.rb
61
- features/step_definitions/standalone_steps.rb
62
- features/step_definitions/thor_steps.rb
63
60
  features/support/env.rb
64
61
  features/support/honeybadger_failure_shim.rb.template
65
62
  features/support/honeybadger_shim.rb.template
66
63
  features/support/rails.rb
67
64
  features/support/rake/Rakefile
68
- features/support/test.thor
69
- features/thor.feature
70
- gemfiles/binding_of_caller.gemfile
71
65
  gemfiles/rack.gemfile
72
- gemfiles/rails.gemfile
66
+ gemfiles/rack.gemfile.lock
73
67
  gemfiles/rails2.3.gemfile
68
+ gemfiles/rails2.3.gemfile.lock
74
69
  gemfiles/rails3.0.gemfile
70
+ gemfiles/rails3.0.gemfile.lock
75
71
  gemfiles/rails3.1.gemfile
72
+ gemfiles/rails3.1.gemfile.lock
76
73
  gemfiles/rails3.2.gemfile
74
+ gemfiles/rails3.2.gemfile.lock
77
75
  gemfiles/rails4.0.gemfile
76
+ gemfiles/rails4.0.gemfile.lock
78
77
  gemfiles/rails4.1.gemfile
78
+ gemfiles/rails4.1.gemfile.lock
79
79
  gemfiles/rake.gemfile
80
+ gemfiles/rake.gemfile.lock
80
81
  gemfiles/sinatra.gemfile
81
- gemfiles/standalone.gemfile
82
- gemfiles/thor.gemfile
82
+ gemfiles/sinatra.gemfile.lock
83
83
  generators/honeybadger/honeybadger_generator.rb
84
84
  generators/honeybadger/lib/insert_commands.rb
85
85
  generators/honeybadger/lib/rake_commands.rb
@@ -94,23 +94,13 @@ Gem::Specification.new do |s|
94
94
  lib/honeybadger/capistrano/legacy.rb
95
95
  lib/honeybadger/capistrano/tasks.rake
96
96
  lib/honeybadger/configuration.rb
97
- lib/honeybadger/dependency.rb
98
- lib/honeybadger/exception_extensions.rb
99
- lib/honeybadger/integrations.rb
100
- lib/honeybadger/integrations/delayed_job.rb
101
- lib/honeybadger/integrations/delayed_job/plugin.rb
102
97
  lib/honeybadger/integrations/sidekiq.rb
103
- lib/honeybadger/integrations/thor.rb
104
98
  lib/honeybadger/monitor.rb
105
99
  lib/honeybadger/monitor/railtie.rb
106
100
  lib/honeybadger/monitor/sender.rb
107
101
  lib/honeybadger/monitor/worker.rb
108
102
  lib/honeybadger/notice.rb
109
- lib/honeybadger/payload.rb
110
103
  lib/honeybadger/rack.rb
111
- lib/honeybadger/rack/error_notifier.rb
112
- lib/honeybadger/rack/user_feedback.rb
113
- lib/honeybadger/rack/user_informer.rb
114
104
  lib/honeybadger/rails.rb
115
105
  lib/honeybadger/rails/action_controller_catcher.rb
116
106
  lib/honeybadger/rails/controller_methods.rb
@@ -134,16 +124,10 @@ Gem::Specification.new do |s|
134
124
  spec/honeybadger/backtrace_spec.rb
135
125
  spec/honeybadger/capistrano_spec.rb
136
126
  spec/honeybadger/configuration_spec.rb
137
- spec/honeybadger/dependency_spec.rb
138
- spec/honeybadger/exception_extensions_spec.rb
139
- spec/honeybadger/integrations/delayed_job_spec.rb
140
- spec/honeybadger/integrations/sidekiq_spec.rb
141
- spec/honeybadger/integrations/thor_spec.rb
142
127
  spec/honeybadger/logger_spec.rb
143
128
  spec/honeybadger/monitor/worker_spec.rb
144
129
  spec/honeybadger/notice_spec.rb
145
130
  spec/honeybadger/notifier_spec.rb
146
- spec/honeybadger/payload_spec.rb
147
131
  spec/honeybadger/rack_spec.rb
148
132
  spec/honeybadger/rails/action_controller_spec.rb
149
133
  spec/honeybadger/rails_spec.rb
@@ -4,7 +4,6 @@ require 'json'
4
4
  require 'digest'
5
5
  require 'logger'
6
6
 
7
- require 'honeybadger/dependency'
8
7
  require 'honeybadger/configuration'
9
8
  require 'honeybadger/backtrace'
10
9
  require 'honeybadger/notice'
@@ -13,13 +12,12 @@ require 'honeybadger/sender'
13
12
  require 'honeybadger/stats'
14
13
  require 'honeybadger/user_informer'
15
14
  require 'honeybadger/user_feedback'
16
- require 'honeybadger/integrations'
17
- require 'honeybadger/exception_extensions'
18
15
 
19
16
  require 'honeybadger/railtie' if defined?(Rails::Railtie)
17
+ require 'honeybadger/integrations/sidekiq'
20
18
 
21
19
  module Honeybadger
22
- VERSION = '1.12.0.beta3'
20
+ VERSION = '1.13.0'
23
21
  LOG_PREFIX = "** [Honeybadger] "
24
22
 
25
23
  HEADERS = {
@@ -164,13 +162,11 @@ module Honeybadger
164
162
  private
165
163
 
166
164
  def send_notice(notice)
167
- return false unless sender
168
-
169
165
  if configuration.public?
170
166
  if configuration.async?
171
167
  configuration.async.call(notice)
172
168
  else
173
- Honeybadger.sender.send_to_honeybadger(notice)
169
+ notice.deliver
174
170
  end
175
171
  end
176
172
  end
@@ -183,14 +179,13 @@ module Honeybadger
183
179
  end
184
180
 
185
181
  def unwrap_exception(exception)
186
- exception.respond_to?(:original_exception) && exception.original_exception ||
187
- exception.respond_to?(:continued_exception) && exception.continued_exception ||
188
- exception.respond_to?(:cause) && exception.cause ||
189
- exception
182
+ if exception.respond_to?(:original_exception)
183
+ exception.original_exception
184
+ elsif exception.respond_to?(:continued_exception)
185
+ exception.continued_exception
186
+ else
187
+ exception
188
+ end
190
189
  end
191
190
  end
192
191
  end
193
-
194
- unless defined?(Rails)
195
- Honeybadger::Dependency.inject!
196
- end
@@ -8,8 +8,7 @@ module Honeybadger
8
8
  :params_filters, :project_root, :port, :protocol, :proxy_host, :proxy_pass,
9
9
  :proxy_port, :proxy_user, :secure, :use_system_ssl_cert_chain, :framework,
10
10
  :user_information, :feedback, :rescue_rake_exceptions, :source_extract_radius,
11
- :send_request_session, :debug, :fingerprint, :hostname, :features, :metrics,
12
- :log_exception_on_send_failure, :send_local_variables].freeze
11
+ :send_request_session, :debug, :fingerprint, :hostname, :metrics, :log_exception_on_send_failure].freeze
13
12
 
14
13
  # The API key for your project, found on the project edit form.
15
14
  attr_accessor :api_key
@@ -101,9 +100,6 @@ module Honeybadger
101
100
  # +true+ to send session data, +false+ to exclude
102
101
  attr_accessor :send_request_session
103
102
 
104
- # +true+ to send local variables, +false+ to exclude
105
- attr_accessor :send_local_variables
106
-
107
103
  # +true+ to log extra debug info, +false+ to suppress
108
104
  attr_accessor :debug
109
105
 
@@ -179,12 +175,11 @@ module Honeybadger
179
175
  @rescue_rake_exceptions = nil
180
176
  @source_extract_radius = 2
181
177
  @send_request_session = true
182
- @send_local_variables = false
183
178
  @debug = false
184
179
  @log_exception_on_send_failure = false
185
180
  @hostname = Socket.gethostname
186
181
  @metrics = true
187
- @features = {'notices' => true, 'local_variables' => true}
182
+ @features = { 'notices' => true }
188
183
  @limit = nil
189
184
  @feedback = true
190
185
  end
@@ -288,10 +283,10 @@ module Honeybadger
288
283
  #
289
284
  # Examples
290
285
  #
291
- # config.async = Proc.new { |notice| Thread.new { Honeybadger.sender.send_to_honeybadger(notice) } }
286
+ # config.async = Proc.new { |notice| Thread.new { notice.deliver } }
292
287
  #
293
288
  # config.async do |notice|
294
- # Thread.new { Honeybadger.sender.send_to_honeybadger(notice) }
289
+ # Thread.new { notice.deliver }
295
290
  # end
296
291
  #
297
292
  # Returns configured async handler (should respond to #call(notice))
@@ -9,26 +9,18 @@ module Honeybadger
9
9
  end
10
10
  end
11
11
  end
12
+ end
12
13
 
13
- Dependency.register do
14
- requirement { defined?(::Sidekiq) }
15
-
16
- injection do
17
- ::Sidekiq.configure_server do |config|
18
- config.server_middleware do |chain|
19
- chain.add Integrations::Sidekiq::Middleware
20
- end
21
- end
14
+ if defined?(::Sidekiq)
15
+ ::Sidekiq.configure_server do |config|
16
+ config.server_middleware do |chain|
17
+ chain.add Honeybadger::Integrations::Sidekiq::Middleware
22
18
  end
23
19
  end
20
+ end
24
21
 
25
- Dependency.register do
26
- requirement { defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3' }
27
-
28
- injection do
29
- ::Sidekiq.configure_server do |config|
30
- config.error_handlers << Proc.new {|ex,context| Honeybadger.notify_or_ignore(ex, :parameters => context) }
31
- end
32
- end
22
+ if defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3'
23
+ ::Sidekiq.configure_server do |config|
24
+ config.error_handlers << Proc.new {|ex,context| Honeybadger.notify_or_ignore(ex, :parameters => context) }
33
25
  end
34
26
  end
@@ -1,4 +1,3 @@
1
- require 'honeybadger/payload'
2
1
  require 'socket'
3
2
 
4
3
  module Honeybadger
@@ -86,15 +85,8 @@ module Honeybadger
86
85
  # The api_key to use when sending notice (optional)
87
86
  attr_reader :api_key
88
87
 
89
- # Local variables are extracted from first frame of backtrace
90
- attr_reader :local_variables
91
-
92
- # Additional features to enable/disable
93
- attr_reader :features
94
-
95
88
  def initialize(args)
96
89
  self.args = args
97
- self.features = args[:features] || {}
98
90
  self.exception = args[:exception]
99
91
  self.project_root = args[:project_root]
100
92
 
@@ -132,9 +124,7 @@ module Honeybadger
132
124
  self.source_extract_radius = args[:source_extract_radius] || 2
133
125
  self.source_extract = extract_source_from_backtrace
134
126
 
135
- self.local_variables = send_local_variables? ? local_variables_from_exception(exception) : {}
136
-
137
- self.send_request_session = args[:send_request_session].nil? ? true : args[:send_request_session]
127
+ self.send_request_session = args[:send_request_session].nil? ? true : args[:send_request_session]
138
128
 
139
129
  also_use_rack_params_filters
140
130
  find_session_data
@@ -143,7 +133,10 @@ module Honeybadger
143
133
  set_context
144
134
  end
145
135
 
146
- # Deprecated. Remove in 2.0.
136
+ # Public: Send the notice to Honeybadger using the configured sender
137
+ #
138
+ # Returns a reference to the error in Honeybadger, false if sender isn't
139
+ # configured
147
140
  def deliver
148
141
  return false unless Honeybadger.sender
149
142
  Honeybadger.sender.send_to_honeybadger(self)
@@ -153,7 +146,7 @@ module Honeybadger
153
146
  #
154
147
  # Returns JSON representation of notice
155
148
  def as_json(options = {})
156
- Payload.new({
149
+ {
157
150
  :api_key => api_key,
158
151
  :notifier => {
159
152
  :name => notifier_name,
@@ -175,8 +168,7 @@ module Honeybadger
175
168
  :params => parameters,
176
169
  :session => session_data,
177
170
  :cgi_data => cgi_data,
178
- :context => context,
179
- :local_variables => local_variables
171
+ :context => context
180
172
  },
181
173
  :server => {
182
174
  :project_root => project_root,
@@ -184,7 +176,7 @@ module Honeybadger
184
176
  :hostname => hostname,
185
177
  :stats => stats
186
178
  }
187
- })
179
+ }
188
180
  end
189
181
 
190
182
  # Public: Creates JSON
@@ -243,9 +235,8 @@ module Honeybadger
243
235
  :error_message, :backtrace_filters, :parameters, :params_filters,
244
236
  :environment_filters, :session_data, :project_root, :url, :ignore,
245
237
  :ignore_by_filters, :notifier_name, :notifier_url, :notifier_version,
246
- :component, :action, :cgi_data, :environment_name, :hostname, :stats,
247
- :context, :source_extract, :source_extract_radius, :send_request_session,
248
- :api_key, :features, :local_variables
238
+ :component, :action, :cgi_data, :environment_name, :hostname, :stats, :context,
239
+ :source_extract, :source_extract_radius, :send_request_session, :api_key
249
240
 
250
241
  # Private: Arguments given in the initializer
251
242
  attr_accessor :args
@@ -479,31 +470,5 @@ module Honeybadger
479
470
  input = input[0...bytes] if input.respond_to?(:size) && input.size > bytes
480
471
  input
481
472
  end
482
-
483
- # Internal: Fetch local variables from first frame of backtrace.
484
- #
485
- # exception - The Exception containing the bindings stack.
486
- #
487
- # Returns a Hash of local variables
488
- def local_variables_from_exception(exception)
489
- return {} unless Exception === exception
490
- return {} if exception.__honeybadger_bindings_stack.empty?
491
-
492
- if project_root
493
- binding = exception.__honeybadger_bindings_stack.find { |b| b.eval('__FILE__') =~ /^#{Regexp.escape(project_root.to_s)}/ }
494
- end
495
-
496
- binding ||= exception.__honeybadger_bindings_stack[0]
497
-
498
- vars = binding.eval('local_variables')
499
- Hash[vars.map {|arg| [arg, binding.eval(arg.to_s)]}]
500
- end
501
-
502
- # Internal: Should local variables be sent?
503
- #
504
- # Returns true to send local_variables
505
- def send_local_variables?
506
- args[:send_local_variables] && features['local_variables']
507
- end
508
473
  end
509
474
  end