smoke_detector 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +50 -0
  4. data/Rakefile +30 -0
  5. data/lib/smoke_detector.rb +37 -0
  6. data/lib/smoke_detector/controller_methods.rb +11 -0
  7. data/lib/smoke_detector/engine.rb +16 -0
  8. data/lib/smoke_detector/exceptions.rb +3 -0
  9. data/lib/smoke_detector/providers.rb +37 -0
  10. data/lib/smoke_detector/providers/airbrake.rb +30 -0
  11. data/lib/smoke_detector/providers/provider.rb +15 -0
  12. data/lib/smoke_detector/providers/rollbar.rb +41 -0
  13. data/lib/smoke_detector/version.rb +3 -0
  14. data/lib/tasks/smoke_detector_tasks.rake +4 -0
  15. data/spec/dummy/README.rdoc +261 -0
  16. data/spec/dummy/Rakefile +7 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  20. data/spec/dummy/app/controllers/widgets_controller.rb +26 -0
  21. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  22. data/spec/dummy/app/models/widget.rb +13 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/app/views/widgets/index.html.erb +1 -0
  25. data/spec/dummy/config.ru +4 -0
  26. data/spec/dummy/config/application.rb +69 -0
  27. data/spec/dummy/config/boot.rb +10 -0
  28. data/spec/dummy/config/database.yml +25 -0
  29. data/spec/dummy/config/environment.rb +5 -0
  30. data/spec/dummy/config/environments/development.rb +37 -0
  31. data/spec/dummy/config/environments/production.rb +67 -0
  32. data/spec/dummy/config/environments/test.rb +37 -0
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  34. data/spec/dummy/config/initializers/inflections.rb +15 -0
  35. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  36. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  37. data/spec/dummy/config/initializers/session_store.rb +8 -0
  38. data/spec/dummy/config/initializers/watch_tower.rb +24 -0
  39. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  40. data/spec/dummy/config/locales/en.yml +5 -0
  41. data/spec/dummy/config/routes.rb +6 -0
  42. data/spec/dummy/db/development.sqlite3 +0 -0
  43. data/spec/dummy/db/schema.rb +16 -0
  44. data/spec/dummy/db/test.sqlite3 +0 -0
  45. data/spec/dummy/log/development.log +8618 -0
  46. data/spec/dummy/log/test.log +11306 -0
  47. data/spec/dummy/public/404.html +26 -0
  48. data/spec/dummy/public/422.html +26 -0
  49. data/spec/dummy/public/500.html +25 -0
  50. data/spec/dummy/public/favicon.ico +0 -0
  51. data/spec/dummy/script/rails +6 -0
  52. data/spec/dummy/tmp/cache/assets/C5F/270/sprockets%2F32a6d17723de2976b8456753922862fc +0 -0
  53. data/spec/dummy/tmp/cache/assets/CA3/870/sprockets%2F703bc6444d2a153516ad9804dc24b467 +0 -0
  54. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  55. data/spec/dummy/tmp/cache/assets/D2F/510/sprockets%2F42e50ab0277768533b1cad2237fb5ade +0 -0
  56. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  57. data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  58. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  59. data/spec/dummy/tmp/cache/assets/DAE/CC0/sprockets%2Fcf340221edaaed61b5821abd28052dbb +0 -0
  60. data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  61. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  62. data/spec/models/providers/airbrake_spec.rb +63 -0
  63. data/spec/models/providers/provider_spec.rb +22 -0
  64. data/spec/models/providers/rollbar_spec.rb +75 -0
  65. data/spec/models/providers_spec.rb +83 -0
  66. data/spec/models/smoke_detector_spec.rb +35 -0
  67. data/spec/requests/aibrake_config_spec.rb +11 -0
  68. data/spec/requests/multi_provider_config_spec.rb +16 -0
  69. data/spec/requests/rollbar_config_spec.rb +13 -0
  70. data/spec/spec_helper.rb +26 -0
  71. data/spec/support/shared_examples_for_providers.rb +63 -0
  72. metadata +326 -0
@@ -0,0 +1,63 @@
1
+ shared_examples_for 'Airbrake integrated error handler' do
2
+ context 'uncaught in a controller' do
3
+ it 'reports the error to Airbrake' do
4
+ Airbrake.should_receive(:notify_or_ignore)
5
+ expect { get '/widgets/bubble_up' }.to raise_error(RuntimeError, 'bubble_up')
6
+ end
7
+ end
8
+
9
+ context 'caught and reported in a controller' do
10
+ it 'reports the error to Airbrake' do
11
+ Airbrake.should_receive(:notify_or_ignore)
12
+ WidgetsController.any_instance.stub(:airbrake_local_request?).and_return(false)
13
+ expect { get '/widgets/catch' }.to_not raise_error(RuntimeError)
14
+ end
15
+ end
16
+
17
+ context 'uncaught in a model' do
18
+ it 'reports the error to Airbrake' do
19
+ Airbrake.should_receive(:notify_or_ignore)
20
+ expect { get '/widgets/deep_bubble_up' }.to raise_error(RuntimeError, 'deep_bubble_up')
21
+ end
22
+ end
23
+
24
+ context 'caught and reported in a model' do
25
+ it 'reports the error to Airbrake' do
26
+ Airbrake.should_receive(:notify)
27
+ expect { get '/widgets/deep_catch' }.to_not raise_error(RuntimeError)
28
+ end
29
+ end
30
+ end
31
+
32
+ shared_examples_for 'Rollbar integrated error handler' do
33
+ context 'uncaught in a controller' do
34
+ it 'reports the error to Rollbar' do
35
+ # TODO why is this firing twice in tests? once in ActionDispatch and once in Test Session
36
+ Rollbar.should_receive(:report_exception).twice.and_return({})
37
+ expect { get '/widgets/bubble_up' }.to raise_error(RuntimeError, 'bubble_up')
38
+ end
39
+ end
40
+
41
+ context 'caught and reported in a controller' do
42
+ it 'reports the error to Rollbar' do
43
+ Rollbar.should_receive(:report_exception)
44
+ expect { get '/widgets/catch' }.to_not raise_error(RuntimeError)
45
+ end
46
+ end
47
+
48
+ context 'uncaught in a model' do
49
+ it 'reports the error to Rollbar' do
50
+ # TODO why is this firing twice in tests? once in ActionDispatch and once in Test Session
51
+ Rollbar.should_receive(:report_exception).twice.and_return({})
52
+ expect { get '/widgets/deep_bubble_up' }.to raise_error(RuntimeError, 'deep_bubble_up')
53
+ end
54
+ end
55
+
56
+ context 'caught and reported in a model' do
57
+ it 'reports the error to Rollbar' do
58
+ Rollbar.should_receive(:report_exception)
59
+ expect { get '/widgets/deep_catch' }.to_not raise_error(RuntimeError)
60
+ end
61
+ end
62
+ end
63
+
metadata ADDED
@@ -0,0 +1,326 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smoke_detector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Friedrich
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-04-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.12
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.12
27
+ - !ruby/object:Gem::Dependency
28
+ name: airbrake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 3.1.8
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 3.1.8
41
+ - !ruby/object:Gem::Dependency
42
+ name: rollbar
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.9.3
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.9.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry-nav
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-rescue
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-stack_explorer
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: ruby-debug19
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: Provides a single interface for posting errors to multiple error reporting
168
+ providers (Airbrake and Rollbar)
169
+ email:
170
+ - cfriedrich@lumoslabs.com
171
+ executables: []
172
+ extensions: []
173
+ extra_rdoc_files: []
174
+ files:
175
+ - lib/smoke_detector/controller_methods.rb
176
+ - lib/smoke_detector/engine.rb
177
+ - lib/smoke_detector/exceptions.rb
178
+ - lib/smoke_detector/providers/airbrake.rb
179
+ - lib/smoke_detector/providers/provider.rb
180
+ - lib/smoke_detector/providers/rollbar.rb
181
+ - lib/smoke_detector/providers.rb
182
+ - lib/smoke_detector/version.rb
183
+ - lib/smoke_detector.rb
184
+ - lib/tasks/smoke_detector_tasks.rake
185
+ - MIT-LICENSE
186
+ - Rakefile
187
+ - README.md
188
+ - spec/dummy/app/assets/javascripts/application.js
189
+ - spec/dummy/app/assets/stylesheets/application.css
190
+ - spec/dummy/app/controllers/application_controller.rb
191
+ - spec/dummy/app/controllers/widgets_controller.rb
192
+ - spec/dummy/app/helpers/application_helper.rb
193
+ - spec/dummy/app/models/widget.rb
194
+ - spec/dummy/app/views/layouts/application.html.erb
195
+ - spec/dummy/app/views/widgets/index.html.erb
196
+ - spec/dummy/config/application.rb
197
+ - spec/dummy/config/boot.rb
198
+ - spec/dummy/config/database.yml
199
+ - spec/dummy/config/environment.rb
200
+ - spec/dummy/config/environments/development.rb
201
+ - spec/dummy/config/environments/production.rb
202
+ - spec/dummy/config/environments/test.rb
203
+ - spec/dummy/config/initializers/backtrace_silencers.rb
204
+ - spec/dummy/config/initializers/inflections.rb
205
+ - spec/dummy/config/initializers/mime_types.rb
206
+ - spec/dummy/config/initializers/secret_token.rb
207
+ - spec/dummy/config/initializers/session_store.rb
208
+ - spec/dummy/config/initializers/watch_tower.rb
209
+ - spec/dummy/config/initializers/wrap_parameters.rb
210
+ - spec/dummy/config/locales/en.yml
211
+ - spec/dummy/config/routes.rb
212
+ - spec/dummy/config.ru
213
+ - spec/dummy/db/development.sqlite3
214
+ - spec/dummy/db/schema.rb
215
+ - spec/dummy/db/test.sqlite3
216
+ - spec/dummy/log/development.log
217
+ - spec/dummy/log/test.log
218
+ - spec/dummy/public/404.html
219
+ - spec/dummy/public/422.html
220
+ - spec/dummy/public/500.html
221
+ - spec/dummy/public/favicon.ico
222
+ - spec/dummy/Rakefile
223
+ - spec/dummy/README.rdoc
224
+ - spec/dummy/script/rails
225
+ - spec/dummy/tmp/cache/assets/C5F/270/sprockets%2F32a6d17723de2976b8456753922862fc
226
+ - spec/dummy/tmp/cache/assets/CA3/870/sprockets%2F703bc6444d2a153516ad9804dc24b467
227
+ - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
228
+ - spec/dummy/tmp/cache/assets/D2F/510/sprockets%2F42e50ab0277768533b1cad2237fb5ade
229
+ - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
230
+ - spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
231
+ - spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
232
+ - spec/dummy/tmp/cache/assets/DAE/CC0/sprockets%2Fcf340221edaaed61b5821abd28052dbb
233
+ - spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
234
+ - spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
235
+ - spec/models/providers/airbrake_spec.rb
236
+ - spec/models/providers/provider_spec.rb
237
+ - spec/models/providers/rollbar_spec.rb
238
+ - spec/models/providers_spec.rb
239
+ - spec/models/smoke_detector_spec.rb
240
+ - spec/requests/aibrake_config_spec.rb
241
+ - spec/requests/multi_provider_config_spec.rb
242
+ - spec/requests/rollbar_config_spec.rb
243
+ - spec/spec_helper.rb
244
+ - spec/support/shared_examples_for_providers.rb
245
+ homepage: https://github.com/lumoslabs/smoke_detector
246
+ licenses: []
247
+ metadata: {}
248
+ post_install_message:
249
+ rdoc_options: []
250
+ require_paths:
251
+ - lib
252
+ required_ruby_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ! '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
257
+ required_rubygems_version: !ruby/object:Gem::Requirement
258
+ requirements:
259
+ - - ! '>='
260
+ - !ruby/object:Gem::Version
261
+ version: '0'
262
+ requirements: []
263
+ rubyforge_project:
264
+ rubygems_version: 2.0.3
265
+ signing_key:
266
+ specification_version: 4
267
+ summary: Errors Alerts
268
+ test_files:
269
+ - spec/dummy/app/assets/javascripts/application.js
270
+ - spec/dummy/app/assets/stylesheets/application.css
271
+ - spec/dummy/app/controllers/application_controller.rb
272
+ - spec/dummy/app/controllers/widgets_controller.rb
273
+ - spec/dummy/app/helpers/application_helper.rb
274
+ - spec/dummy/app/models/widget.rb
275
+ - spec/dummy/app/views/layouts/application.html.erb
276
+ - spec/dummy/app/views/widgets/index.html.erb
277
+ - spec/dummy/config/application.rb
278
+ - spec/dummy/config/boot.rb
279
+ - spec/dummy/config/database.yml
280
+ - spec/dummy/config/environment.rb
281
+ - spec/dummy/config/environments/development.rb
282
+ - spec/dummy/config/environments/production.rb
283
+ - spec/dummy/config/environments/test.rb
284
+ - spec/dummy/config/initializers/backtrace_silencers.rb
285
+ - spec/dummy/config/initializers/inflections.rb
286
+ - spec/dummy/config/initializers/mime_types.rb
287
+ - spec/dummy/config/initializers/secret_token.rb
288
+ - spec/dummy/config/initializers/session_store.rb
289
+ - spec/dummy/config/initializers/watch_tower.rb
290
+ - spec/dummy/config/initializers/wrap_parameters.rb
291
+ - spec/dummy/config/locales/en.yml
292
+ - spec/dummy/config/routes.rb
293
+ - spec/dummy/config.ru
294
+ - spec/dummy/db/development.sqlite3
295
+ - spec/dummy/db/schema.rb
296
+ - spec/dummy/db/test.sqlite3
297
+ - spec/dummy/log/development.log
298
+ - spec/dummy/log/test.log
299
+ - spec/dummy/public/404.html
300
+ - spec/dummy/public/422.html
301
+ - spec/dummy/public/500.html
302
+ - spec/dummy/public/favicon.ico
303
+ - spec/dummy/Rakefile
304
+ - spec/dummy/README.rdoc
305
+ - spec/dummy/script/rails
306
+ - spec/dummy/tmp/cache/assets/C5F/270/sprockets%2F32a6d17723de2976b8456753922862fc
307
+ - spec/dummy/tmp/cache/assets/CA3/870/sprockets%2F703bc6444d2a153516ad9804dc24b467
308
+ - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
309
+ - spec/dummy/tmp/cache/assets/D2F/510/sprockets%2F42e50ab0277768533b1cad2237fb5ade
310
+ - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
311
+ - spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
312
+ - spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
313
+ - spec/dummy/tmp/cache/assets/DAE/CC0/sprockets%2Fcf340221edaaed61b5821abd28052dbb
314
+ - spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
315
+ - spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
316
+ - spec/models/providers/airbrake_spec.rb
317
+ - spec/models/providers/provider_spec.rb
318
+ - spec/models/providers/rollbar_spec.rb
319
+ - spec/models/providers_spec.rb
320
+ - spec/models/smoke_detector_spec.rb
321
+ - spec/requests/aibrake_config_spec.rb
322
+ - spec/requests/multi_provider_config_spec.rb
323
+ - spec/requests/rollbar_config_spec.rb
324
+ - spec/spec_helper.rb
325
+ - spec/support/shared_examples_for_providers.rb
326
+ has_rdoc: