honeybadger 1.9.5 → 1.10.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Appraisals +0 -12
  2. data/CHANGELOG.md +19 -5
  3. data/Gemfile.lock +1 -5
  4. data/MIT-LICENSE +6 -5
  5. data/README.md +6 -596
  6. data/Rakefile +5 -5
  7. data/features/rails.feature +37 -12
  8. data/features/step_definitions/rails_steps.rb +20 -0
  9. data/features/support/honeybadger_shim.rb.template +3 -5
  10. data/gemfiles/rack.gemfile +0 -1
  11. data/gemfiles/rack.gemfile.lock +1 -8
  12. data/gemfiles/rails2.3.gemfile +0 -1
  13. data/gemfiles/rails2.3.gemfile.lock +1 -8
  14. data/gemfiles/rails3.0.gemfile +0 -2
  15. data/gemfiles/rails3.0.gemfile.lock +2 -12
  16. data/gemfiles/rails3.1.gemfile +0 -2
  17. data/gemfiles/rails3.1.gemfile.lock +3 -13
  18. data/gemfiles/rails3.2.gemfile +0 -2
  19. data/gemfiles/rails3.2.gemfile.lock +4 -14
  20. data/gemfiles/rails4.gemfile +0 -2
  21. data/gemfiles/rails4.gemfile.lock +4 -14
  22. data/gemfiles/rake.gemfile +0 -1
  23. data/gemfiles/rake.gemfile.lock +1 -8
  24. data/gemfiles/sinatra.gemfile +0 -1
  25. data/gemfiles/sinatra.gemfile.lock +1 -8
  26. data/honeybadger.gemspec +7 -3
  27. data/lib/honeybadger.rb +7 -5
  28. data/lib/honeybadger/configuration.rb +7 -3
  29. data/lib/honeybadger/monitor/sender.rb +4 -6
  30. data/lib/honeybadger/notice.rb +30 -4
  31. data/lib/honeybadger/rails.rb +2 -0
  32. data/lib/honeybadger/rails3_tasks.rb +2 -2
  33. data/lib/honeybadger/railtie.rb +3 -1
  34. data/lib/honeybadger/sender.rb +63 -53
  35. data/lib/honeybadger/templates/feedback_form.html.erb +82 -0
  36. data/lib/honeybadger/user_feedback.rb +42 -0
  37. data/lib/honeybadger/user_informer.rb +26 -0
  38. data/spec/honeybadger/configuration_spec.rb +4 -1
  39. data/spec/honeybadger/logger_spec.rb +25 -2
  40. data/spec/honeybadger/notice_spec.rb +69 -3
  41. data/spec/honeybadger/sender_spec.rb +77 -54
  42. data/spec/honeybadger/user_feedback_spec.rb +55 -0
  43. data/spec/honeybadger/user_informer_spec.rb +30 -0
  44. data/spec/support/helpers.rb +9 -6
  45. metadata +63 -39
  46. checksums.yaml +0 -7
@@ -0,0 +1,55 @@
1
+ require 'spec_helper'
2
+ require 'sham_rack'
3
+
4
+ describe Honeybadger::UserFeedback do
5
+ let(:main_app) do
6
+ lambda do |env|
7
+ env['honeybadger.error_id'] = honeybadger_id if defined?(honeybadger_id)
8
+ [200, {}, ["<!-- HONEYBADGER FEEDBACK -->"]]
9
+ end
10
+ end
11
+ let(:informer_app) { Honeybadger::UserFeedback.new(main_app) }
12
+ let(:response) { Net::HTTP.get_response(URI.parse("http://example.com/")) }
13
+
14
+ before do
15
+ ShamRack.mount(informer_app, "example.com")
16
+ end
17
+
18
+ context "feedback feature is disabled by ping" do
19
+ it 'does not modify the output' do
20
+ expect(response.body).to eq '<!-- HONEYBADGER FEEDBACK -->'
21
+ end
22
+ end
23
+
24
+ context "feedback feature is enabled by ping" do
25
+ before do
26
+ Honeybadger.configuration.features['feedback'] = true
27
+ end
28
+
29
+ context "there is a honeybadger id" do
30
+ let(:honeybadger_id) { 1 }
31
+
32
+ it 'modifies output' do
33
+ rendered_length = informer_app.render_form(1).size
34
+ expect(response.body).to match(/honeybadger_feedback_token/)
35
+ expect(response["Content-Length"].to_i).to eq rendered_length
36
+ end
37
+
38
+ context "feedback feature is disabled by customer" do
39
+ before do
40
+ Honeybadger.configuration.feedback = false
41
+ end
42
+
43
+ it 'does not modify the output' do
44
+ expect(response.body).to eq '<!-- HONEYBADGER FEEDBACK -->'
45
+ end
46
+ end
47
+ end
48
+
49
+ context "there is no honeybadger id" do
50
+ it 'does not modify the output' do
51
+ expect(response.body).to eq '<!-- HONEYBADGER FEEDBACK -->'
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+ require 'sham_rack'
3
+
4
+ describe Honeybadger::UserInformer do
5
+ it 'modifies output if there is a honeybadger id' do
6
+ main_app = lambda do |env|
7
+ env['honeybadger.error_id'] = 1
8
+ [200, {}, ["<!-- HONEYBADGER ERROR -->"]]
9
+ end
10
+ informer_app = Honeybadger::UserInformer.new(main_app)
11
+
12
+ ShamRack.mount(informer_app, "example.com")
13
+
14
+ response = Net::HTTP.get_response(URI.parse("http://example.com/"))
15
+ expect(response.body).to eq 'Honeybadger Error 1'
16
+ expect(response["Content-Length"].to_i).to eq 19
17
+ end
18
+
19
+ it 'does not modify output if there is no honeybadger id' do
20
+ main_app = lambda do |env|
21
+ [200, {}, ["<!-- HONEYBADGER ERROR -->"]]
22
+ end
23
+ informer_app = Honeybadger::UserInformer.new(main_app)
24
+
25
+ ShamRack.mount(informer_app, "example.com")
26
+
27
+ response = Net::HTTP.get_response(URI.parse("http://example.com/"))
28
+ expect(response.body).to eq '<!-- HONEYBADGER ERROR -->'
29
+ end
30
+ end
@@ -24,12 +24,15 @@ module Helpers
24
24
  end
25
25
 
26
26
  def stub_http(options = {})
27
- response = options[:response] || Faraday::Response.new(:status => 200)
27
+ response = options[:response] || Net::HTTPSuccess.new('1.2', '200', 'OK')
28
28
  response.stub(:body => options[:body] || '{"id":"1234"}')
29
-
30
- http = Faraday.new
31
- http.stub(:post).and_return(response)
32
- Faraday.stub(:new => http)
29
+ http = double(:post => response,
30
+ :read_timeout= => nil,
31
+ :open_timeout= => nil,
32
+ :ca_file= => nil,
33
+ :verify_mode= => nil,
34
+ :use_ssl= => nil)
35
+ Net::HTTP.stub(:new).and_return(http)
33
36
  http
34
37
  end
35
38
 
@@ -43,7 +46,7 @@ module Helpers
43
46
  def build_notice_data(exception = nil)
44
47
  exception ||= build_exception
45
48
  {
46
- :api_key => 'abc123',
49
+ :api_key => nil,
47
50
  :error_class => exception.class.name,
48
51
  :error_message => "#{exception.class.name}: #{exception.message}",
49
52
  :backtrace => exception.backtrace,
metadata CHANGED
@@ -1,46 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.10.0.beta1
5
+ prerelease: 7
5
6
  platform: ruby
6
7
  authors:
7
8
  - Joshua Wood
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-12-06 00:00:00.000000000 Z
12
+ date: 2013-12-04 00:00:00.000000000 Z
12
13
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: faraday
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '0.7'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '0.7'
27
14
  - !ruby/object:Gem::Dependency
28
15
  name: json
29
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
30
18
  requirements:
31
- - - '>='
19
+ - - ! '>='
32
20
  - !ruby/object:Gem::Version
33
21
  version: '0'
34
22
  type: :runtime
35
23
  prerelease: false
36
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
37
26
  requirements:
38
- - - '>='
27
+ - - ! '>='
39
28
  - !ruby/object:Gem::Version
40
29
  version: '0'
41
30
  - !ruby/object:Gem::Dependency
42
31
  name: cucumber
43
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
44
34
  requirements:
45
35
  - - ~>
46
36
  - !ruby/object:Gem::Version
@@ -48,6 +38,7 @@ dependencies:
48
38
  type: :development
49
39
  prerelease: false
50
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
51
42
  requirements:
52
43
  - - ~>
53
44
  - !ruby/object:Gem::Version
@@ -55,6 +46,7 @@ dependencies:
55
46
  - !ruby/object:Gem::Dependency
56
47
  name: rspec
57
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
58
50
  requirements:
59
51
  - - ~>
60
52
  - !ruby/object:Gem::Version
@@ -62,6 +54,7 @@ dependencies:
62
54
  type: :development
63
55
  prerelease: false
64
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
65
58
  requirements:
66
59
  - - ~>
67
60
  - !ruby/object:Gem::Version
@@ -69,6 +62,7 @@ dependencies:
69
62
  - !ruby/object:Gem::Dependency
70
63
  name: sham_rack
71
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
72
66
  requirements:
73
67
  - - ~>
74
68
  - !ruby/object:Gem::Version
@@ -76,6 +70,7 @@ dependencies:
76
70
  type: :development
77
71
  prerelease: false
78
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
79
74
  requirements:
80
75
  - - ~>
81
76
  - !ruby/object:Gem::Version
@@ -83,6 +78,7 @@ dependencies:
83
78
  - !ruby/object:Gem::Dependency
84
79
  name: capistrano
85
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
86
82
  requirements:
87
83
  - - ~>
88
84
  - !ruby/object:Gem::Version
@@ -90,6 +86,7 @@ dependencies:
90
86
  type: :development
91
87
  prerelease: false
92
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
93
90
  requirements:
94
91
  - - ~>
95
92
  - !ruby/object:Gem::Version
@@ -97,6 +94,7 @@ dependencies:
97
94
  - !ruby/object:Gem::Dependency
98
95
  name: guard
99
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
100
98
  requirements:
101
99
  - - ~>
102
100
  - !ruby/object:Gem::Version
@@ -104,6 +102,7 @@ dependencies:
104
102
  type: :development
105
103
  prerelease: false
106
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
107
106
  requirements:
108
107
  - - ~>
109
108
  - !ruby/object:Gem::Version
@@ -111,113 +110,129 @@ dependencies:
111
110
  - !ruby/object:Gem::Dependency
112
111
  name: guard-rspec
113
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
114
  requirements:
115
- - - '>='
115
+ - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
121
122
  requirements:
122
- - - '>='
123
+ - - ! '>='
123
124
  - !ruby/object:Gem::Version
124
125
  version: '0'
125
126
  - !ruby/object:Gem::Dependency
126
127
  name: rake
127
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
128
130
  requirements:
129
- - - '>='
131
+ - - ! '>='
130
132
  - !ruby/object:Gem::Version
131
133
  version: '0'
132
134
  type: :development
133
135
  prerelease: false
134
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
135
138
  requirements:
136
- - - '>='
139
+ - - ! '>='
137
140
  - !ruby/object:Gem::Version
138
141
  version: '0'
139
142
  - !ruby/object:Gem::Dependency
140
143
  name: sinatra
141
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
142
146
  requirements:
143
- - - '>='
147
+ - - ! '>='
144
148
  - !ruby/object:Gem::Version
145
149
  version: '0'
146
150
  type: :development
147
151
  prerelease: false
148
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
149
154
  requirements:
150
- - - '>='
155
+ - - ! '>='
151
156
  - !ruby/object:Gem::Version
152
157
  version: '0'
153
158
  - !ruby/object:Gem::Dependency
154
159
  name: aruba
155
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
156
162
  requirements:
157
- - - '>='
163
+ - - ! '>='
158
164
  - !ruby/object:Gem::Version
159
165
  version: '0'
160
166
  type: :development
161
167
  prerelease: false
162
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
163
170
  requirements:
164
- - - '>='
171
+ - - ! '>='
165
172
  - !ruby/object:Gem::Version
166
173
  version: '0'
167
174
  - !ruby/object:Gem::Dependency
168
175
  name: appraisal
169
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
170
178
  requirements:
171
- - - '>='
179
+ - - ! '>='
172
180
  - !ruby/object:Gem::Version
173
181
  version: '0'
174
182
  type: :development
175
183
  prerelease: false
176
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
177
186
  requirements:
178
- - - '>='
187
+ - - ! '>='
179
188
  - !ruby/object:Gem::Version
180
189
  version: '0'
181
190
  - !ruby/object:Gem::Dependency
182
191
  name: fuubar
183
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
184
194
  requirements:
185
- - - '>='
195
+ - - ! '>='
186
196
  - !ruby/object:Gem::Version
187
197
  version: '0'
188
198
  type: :development
189
199
  prerelease: false
190
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
191
202
  requirements:
192
- - - '>='
203
+ - - ! '>='
193
204
  - !ruby/object:Gem::Version
194
205
  version: '0'
195
206
  - !ruby/object:Gem::Dependency
196
207
  name: growl
197
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
198
210
  requirements:
199
- - - '>='
211
+ - - ! '>='
200
212
  - !ruby/object:Gem::Version
201
213
  version: '0'
202
214
  type: :development
203
215
  prerelease: false
204
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
205
218
  requirements:
206
- - - '>='
219
+ - - ! '>='
207
220
  - !ruby/object:Gem::Version
208
221
  version: '0'
209
222
  - !ruby/object:Gem::Dependency
210
223
  name: webmock
211
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
212
226
  requirements:
213
- - - '>='
227
+ - - ! '>='
214
228
  - !ruby/object:Gem::Version
215
229
  version: '0'
216
230
  type: :development
217
231
  prerelease: false
218
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
219
234
  requirements:
220
- - - '>='
235
+ - - ! '>='
221
236
  - !ruby/object:Gem::Version
222
237
  version: '0'
223
238
  description: Make managing application errors a more pleasant experience.
@@ -295,6 +310,9 @@ files:
295
310
  - lib/honeybadger/shared_tasks.rb
296
311
  - lib/honeybadger/stats.rb
297
312
  - lib/honeybadger/tasks.rb
313
+ - lib/honeybadger/templates/feedback_form.html.erb
314
+ - lib/honeybadger/user_feedback.rb
315
+ - lib/honeybadger/user_informer.rb
298
316
  - lib/honeybadger_tasks.rb
299
317
  - lib/rails/generators/honeybadger/honeybadger_generator.rb
300
318
  - rails/init.rb
@@ -312,6 +330,8 @@ files:
312
330
  - spec/honeybadger/rails/action_controller_spec.rb
313
331
  - spec/honeybadger/rails_spec.rb
314
332
  - spec/honeybadger/sender_spec.rb
333
+ - spec/honeybadger/user_feedback_spec.rb
334
+ - spec/honeybadger/user_informer_spec.rb
315
335
  - spec/honeybadger_tasks_spec.rb
316
336
  - spec/spec_helper.rb
317
337
  - spec/support/array_including.rb
@@ -321,7 +341,6 @@ files:
321
341
  - spec/support/helpers.rb
322
342
  homepage: http://www.honeybadger.io
323
343
  licenses: []
324
- metadata: {}
325
344
  post_install_message:
326
345
  rdoc_options:
327
346
  - --charset=UTF-8
@@ -329,18 +348,23 @@ rdoc_options:
329
348
  require_paths:
330
349
  - lib
331
350
  required_ruby_version: !ruby/object:Gem::Requirement
351
+ none: false
332
352
  requirements:
333
- - - '>='
353
+ - - ! '>='
334
354
  - !ruby/object:Gem::Version
335
355
  version: '0'
356
+ segments:
357
+ - 0
358
+ hash: -735420527713291381
336
359
  required_rubygems_version: !ruby/object:Gem::Requirement
360
+ none: false
337
361
  requirements:
338
- - - '>='
362
+ - - ! '>'
339
363
  - !ruby/object:Gem::Version
340
- version: '0'
364
+ version: 1.3.1
341
365
  requirements: []
342
366
  rubyforge_project:
343
- rubygems_version: 2.1.5
367
+ rubygems_version: 1.8.23
344
368
  signing_key:
345
369
  specification_version: 2
346
370
  summary: Error reports you can be happy about.
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: dd5d724bc0336e08b1ecc6f49f1e1508f21c7174
4
- data.tar.gz: 57a61bc6a3d43587c00f106ac290bac232f6c5d9
5
- SHA512:
6
- metadata.gz: 55735a6b7bbf0fc130005599f33568adc7a158a3b35ff2a04599b63ce7dd25b37bc55e56594e07f28cd2882e53ea816e34dc417823c58fe4f04497a48a81d1f2
7
- data.tar.gz: d68d1302ba96a55d3363880d14115d6fdac5b435add9417063672b044ef7860995fc5d8514d60e47c30f900e5e340fac602635e80be18bcb108c63c70d988d40