airbrake 3.1.17 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,12 @@
1
+ Version 3.2.0 - 2014-05-23 17:37:35 -0700
2
+ ===============================================================================
3
+
4
+ Ali Faiz (4):
5
+ Remove JS notifier from templates and libraries
6
+ Cleanup references to JS notifier in tests
7
+ Merge pull request #297 from airbrake/remove-js-notifier
8
+
9
+
1
10
  Version 3.1.17 - 2014-05-20 21:00:25 -0700
2
11
  ===============================================================================
3
12
 
@@ -260,7 +269,7 @@ Hrvoje Šimić (6):
260
269
  thread safety fix
261
270
  add the secure option to the generator
262
271
  fix the broken generator method call
263
- be more careful with @template in javascript notifier
272
+ be more careful with @template in javascript notifier
264
273
  update tested rails versions
265
274
 
266
275
  Marko Šiftar (2):
@@ -1358,5 +1367,6 @@ Nick Quaranto (3):
1358
1367
 
1359
1368
 
1360
1369
 
1370
+
1361
1371
 
1362
1372
 
data/Rakefile CHANGED
@@ -158,7 +158,7 @@ def cucumber_opts
158
158
 
159
159
  case ENV["BUNDLE_GEMFILE"]
160
160
  when /rails/
161
- opts << "features/rails.feature features/rails_with_js_notifier.feature features/metal.feature features/user_informer.feature"
161
+ opts << "features/rails.feature features/metal.feature features/user_informer.feature"
162
162
  when /rack/
163
163
  opts << "features/rack.feature"
164
164
  when /sinatra/
@@ -192,32 +192,6 @@ When /^I configure the application to filter parameter "([^\"]*)"$/ do |paramete
192
192
  end
193
193
  end
194
194
 
195
- Then /^I should see the notifier JavaScript for the following:$/ do |table|
196
- hash = table.hashes.first
197
- host = hash['host'] || 'api.airbrake.io'
198
- secure = hash['secure'] || false
199
- api_key = hash['api_key']
200
- environment = hash['environment'] || 'production'
201
-
202
- steps %{
203
- Then the output should contain "#{host}/javascripts/notifier.js"
204
- And the output should contain "Airbrake.setKey('#{api_key}');"
205
- And the output should contain "Airbrake.setHost('#{host}');"
206
- And the output should contain "Airbrake.setEnvironment('#{environment}');"
207
- }
208
- end
209
-
210
- Then /^the notifier JavaScript should provide the following errorDefaults:$/ do |table|
211
- hash = table.hashes.first
212
- hash.each do |key, value|
213
- assert_matching_output("Airbrake\.setErrorDefaults.*#{key}: \"#{value}\"",all_output)
214
- end
215
- end
216
-
217
- Then /^I should not see notifier JavaScript$/ do
218
- step %{the output should not contain "script[type='text/javascript'][src$='/javascripts/notifier.js']"}
219
- end
220
-
221
195
  When /^I have set up authentication system in my app that uses "([^\"]*)"$/ do |current_user|
222
196
  application_controller = File.join(rails_root, 'app', 'controllers', "application_controller.rb")
223
197
  definition =
@@ -2,7 +2,7 @@ module Airbrake
2
2
  # Used to set up and modify settings for the notifier.
3
3
  class Configuration
4
4
 
5
- OPTIONS = [:api_key, :js_api_key, :backtrace_filters, :development_environments,
5
+ OPTIONS = [:api_key, :backtrace_filters, :development_environments,
6
6
  :development_lookup, :environment_name, :host,
7
7
  :http_open_timeout, :http_read_timeout, :ignore, :ignore_by_filters,
8
8
  :ignore_user_agent, :notifier_name, :notifier_url, :notifier_version,
@@ -14,12 +14,6 @@ module Airbrake
14
14
  # The API key for your project, found on the project edit form.
15
15
  attr_accessor :api_key
16
16
 
17
- # If you're using the Javascript notifier and would want to separate
18
- # Javascript notifications into another Airbrake project, specify
19
- # its APi key here.
20
- # Defaults to #api_key (of the base project)
21
- attr_writer :js_api_key
22
-
23
17
  # The host to connect to (defaults to airbrake.io).
24
18
  attr_accessor :host
25
19
 
@@ -158,7 +152,6 @@ module Airbrake
158
152
  alias_method :use_system_ssl_cert_chain?, :use_system_ssl_cert_chain
159
153
 
160
154
  def initialize
161
- @js_api_key = nil
162
155
  @secure = false
163
156
  @use_system_ssl_cert_chain= false
164
157
  @host = 'api.airbrake.io'
@@ -311,14 +304,6 @@ module Airbrake
311
304
  @rescue_rake_exceptions = val
312
305
  end
313
306
 
314
- def js_api_key
315
- @js_api_key || self.api_key
316
- end
317
-
318
- def js_notifier=(*args)
319
- warn '[AIRBRAKE] config.js_notifier has been deprecated and has no effect. You should use <%= airbrake_javascript_notifier %> directly at the top of your layouts. Be sure to place it before all other javascript.'
320
- end
321
-
322
307
  def ca_bundle_path
323
308
  if use_system_ssl_cert_chain? && File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
324
309
  OpenSSL::X509::DEFAULT_CERT_FILE
@@ -2,7 +2,6 @@ require 'airbrake'
2
2
  require 'airbrake/rails/controller_methods'
3
3
  require 'airbrake/rails/action_controller_catcher'
4
4
  require 'airbrake/rails/error_lookup'
5
- require 'airbrake/rails/javascript_notifier'
6
5
 
7
6
  module Airbrake
8
7
  module Rails
@@ -11,7 +10,6 @@ module Airbrake
11
10
  ActionController::Base.send(:include, Airbrake::Rails::ActionControllerCatcher)
12
11
  ActionController::Base.send(:include, Airbrake::Rails::ErrorLookup)
13
12
  ActionController::Base.send(:include, Airbrake::Rails::ControllerMethods)
14
- ActionController::Base.send(:include, Airbrake::Rails::JavascriptNotifier)
15
13
  end
16
14
 
17
15
  rails_logger = if defined?(::Rails.logger)
@@ -41,12 +41,6 @@ module Airbrake
41
41
 
42
42
  include Airbrake::Rails::ControllerMethods
43
43
  end
44
-
45
- if defined?(::ActionController::Base)
46
- require 'airbrake/rails/javascript_notifier'
47
-
48
- ::ActionController::Base.send(:include, Airbrake::Rails::JavascriptNotifier)
49
- end
50
44
  end
51
45
  end
52
46
  end
@@ -1,3 +1,3 @@
1
1
  module Airbrake
2
- VERSION = "3.1.17".freeze
2
+ VERSION = "3.2.0".freeze
3
3
  end
@@ -127,14 +127,6 @@ class ConfigurationTest < Test::Unit::TestCase
127
127
  assert_appends_value :rake_environment_filters
128
128
  end
129
129
 
130
- should "warn when attempting to write js_notifier" do
131
- config = Airbrake::Configuration.new
132
- config.
133
- expects(:warn).
134
- with(regexp_matches(/deprecated/i))
135
- config.js_notifier = true
136
- end
137
-
138
130
  should "allow ignored user agents to be appended" do
139
131
  assert_appends_value :ignore_user_agent
140
132
  end
@@ -11,5 +11,4 @@ silence_warnings do
11
11
  require "action_view"
12
12
  end
13
13
 
14
- require File.expand_path "../integration/javascript_notifier_test", __FILE__
15
14
  require File.expand_path "../integration/catcher_test", __FILE__
metadata CHANGED
@@ -1,46 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.17
4
+ version: 3.2.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Airbrake
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
12
+ date: 2014-05-27 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: builder
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: multi_json
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: bourne
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: cucumber-rails
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: fakeweb
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: nokogiri
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: rspec
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ~>
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: sham_rack
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - ~>
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - ~>
123
140
  - !ruby/object:Gem::Version
@@ -125,6 +142,7 @@ dependencies:
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: json-schema
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - ~>
130
148
  - !ruby/object:Gem::Version
@@ -132,6 +150,7 @@ dependencies:
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
155
  - - ~>
137
156
  - !ruby/object:Gem::Version
@@ -139,6 +158,7 @@ dependencies:
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: capistrano
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
163
  - - ~>
144
164
  - !ruby/object:Gem::Version
@@ -146,6 +166,7 @@ dependencies:
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
171
  - - ~>
151
172
  - !ruby/object:Gem::Version
@@ -153,62 +174,71 @@ dependencies:
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: aruba
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
- - - '>='
179
+ - - ! '>='
158
180
  - !ruby/object:Gem::Version
159
181
  version: '0'
160
182
  type: :development
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
- - - '>='
187
+ - - ! '>='
165
188
  - !ruby/object:Gem::Version
166
189
  version: '0'
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: appraisal
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
- - - '>='
195
+ - - ! '>='
172
196
  - !ruby/object:Gem::Version
173
197
  version: '0'
174
198
  type: :development
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
- - - '>='
203
+ - - ! '>='
179
204
  - !ruby/object:Gem::Version
180
205
  version: '0'
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: rspec-rails
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
- - - '>='
211
+ - - ! '>='
186
212
  - !ruby/object:Gem::Version
187
213
  version: '0'
188
214
  type: :development
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
- - - '>='
219
+ - - ! '>='
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: girl_friday
197
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
- - - '>='
227
+ - - ! '>='
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
205
234
  requirements:
206
- - - '>='
235
+ - - ! '>='
207
236
  - !ruby/object:Gem::Version
208
237
  version: '0'
209
238
  - !ruby/object:Gem::Dependency
210
239
  name: sucker_punch
211
240
  requirement: !ruby/object:Gem::Requirement
241
+ none: false
212
242
  requirements:
213
243
  - - '='
214
244
  - !ruby/object:Gem::Version
@@ -216,6 +246,7 @@ dependencies:
216
246
  type: :development
217
247
  prerelease: false
218
248
  version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
219
250
  requirements:
220
251
  - - '='
221
252
  - !ruby/object:Gem::Version
@@ -223,62 +254,71 @@ dependencies:
223
254
  - !ruby/object:Gem::Dependency
224
255
  name: shoulda-matchers
225
256
  requirement: !ruby/object:Gem::Requirement
257
+ none: false
226
258
  requirements:
227
- - - '>='
259
+ - - ! '>='
228
260
  - !ruby/object:Gem::Version
229
261
  version: '0'
230
262
  type: :development
231
263
  prerelease: false
232
264
  version_requirements: !ruby/object:Gem::Requirement
265
+ none: false
233
266
  requirements:
234
- - - '>='
267
+ - - ! '>='
235
268
  - !ruby/object:Gem::Version
236
269
  version: '0'
237
270
  - !ruby/object:Gem::Dependency
238
271
  name: shoulda-context
239
272
  requirement: !ruby/object:Gem::Requirement
273
+ none: false
240
274
  requirements:
241
- - - '>='
275
+ - - ! '>='
242
276
  - !ruby/object:Gem::Version
243
277
  version: '0'
244
278
  type: :development
245
279
  prerelease: false
246
280
  version_requirements: !ruby/object:Gem::Requirement
281
+ none: false
247
282
  requirements:
248
- - - '>='
283
+ - - ! '>='
249
284
  - !ruby/object:Gem::Version
250
285
  version: '0'
251
286
  - !ruby/object:Gem::Dependency
252
287
  name: pry
253
288
  requirement: !ruby/object:Gem::Requirement
289
+ none: false
254
290
  requirements:
255
- - - '>='
291
+ - - ! '>='
256
292
  - !ruby/object:Gem::Version
257
293
  version: '0'
258
294
  type: :development
259
295
  prerelease: false
260
296
  version_requirements: !ruby/object:Gem::Requirement
297
+ none: false
261
298
  requirements:
262
- - - '>='
299
+ - - ! '>='
263
300
  - !ruby/object:Gem::Version
264
301
  version: '0'
265
302
  - !ruby/object:Gem::Dependency
266
303
  name: coveralls
267
304
  requirement: !ruby/object:Gem::Requirement
305
+ none: false
268
306
  requirements:
269
- - - '>='
307
+ - - ! '>='
270
308
  - !ruby/object:Gem::Version
271
309
  version: '0'
272
310
  type: :development
273
311
  prerelease: false
274
312
  version_requirements: !ruby/object:Gem::Requirement
313
+ none: false
275
314
  requirements:
276
- - - '>='
315
+ - - ! '>='
277
316
  - !ruby/object:Gem::Version
278
317
  version: '0'
279
318
  - !ruby/object:Gem::Dependency
280
319
  name: minitest
281
320
  requirement: !ruby/object:Gem::Requirement
321
+ none: false
282
322
  requirements:
283
323
  - - ~>
284
324
  - !ruby/object:Gem::Version
@@ -286,6 +326,7 @@ dependencies:
286
326
  type: :development
287
327
  prerelease: false
288
328
  version_requirements: !ruby/object:Gem::Requirement
329
+ none: false
289
330
  requirements:
290
331
  - - ~>
291
332
  - !ruby/object:Gem::Version
@@ -297,42 +338,12 @@ executables:
297
338
  extensions: []
298
339
  extra_rdoc_files: []
299
340
  files:
300
- - CHANGELOG
301
- - Gemfile
302
- - Guardfile
303
- - INSTALL
304
- - LICENSE
305
- - README.md
306
- - README_FOR_HEROKU_ADDON.md
307
- - Rakefile
308
- - TESTED_AGAINST
309
- - airbrake.gemspec
310
- - bin/airbrake
311
- - features/metal.feature
312
- - features/rack.feature
313
- - features/rails.feature
314
- - features/rails_with_js_notifier.feature
315
- - features/rake.feature
316
- - features/sinatra.feature
317
- - features/step_definitions/file_steps.rb
318
- - features/step_definitions/rack_steps.rb
319
- - features/step_definitions/rails_application_steps.rb
320
- - features/step_definitions/rake_steps.rb
321
- - features/support/airbrake_shim.rb.template
322
- - features/support/aruba.rb
323
- - features/support/env.rb
324
- - features/support/matchers.rb
325
- - features/support/rails.rb
326
- - features/support/rake/Rakefile
327
- - features/user_informer.feature
328
341
  - generators/airbrake/airbrake_generator.rb
329
342
  - generators/airbrake/lib/insert_commands.rb
330
343
  - generators/airbrake/lib/rake_commands.rb
331
344
  - generators/airbrake/templates/airbrake_tasks.rake
332
345
  - generators/airbrake/templates/capistrano_hook.rb
333
346
  - generators/airbrake/templates/initializer.rb
334
- - install.rb
335
- - lib/airbrake.rb
336
347
  - lib/airbrake/backtrace.rb
337
348
  - lib/airbrake/capistrano.rb
338
349
  - lib/airbrake/capistrano3.rb
@@ -347,12 +358,11 @@ files:
347
358
  - lib/airbrake/jobs/send_job.rb
348
359
  - lib/airbrake/notice.rb
349
360
  - lib/airbrake/rack.rb
350
- - lib/airbrake/rails.rb
351
361
  - lib/airbrake/rails/action_controller_catcher.rb
352
362
  - lib/airbrake/rails/controller_methods.rb
353
363
  - lib/airbrake/rails/error_lookup.rb
354
- - lib/airbrake/rails/javascript_notifier.rb
355
364
  - lib/airbrake/rails/middleware.rb
365
+ - lib/airbrake/rails.rb
356
366
  - lib/airbrake/rails3_tasks.rb
357
367
  - lib/airbrake/railtie.rb
358
368
  - lib/airbrake/rake_handler.rb
@@ -360,32 +370,41 @@ files:
360
370
  - lib/airbrake/sender.rb
361
371
  - lib/airbrake/shared_tasks.rb
362
372
  - lib/airbrake/sinatra.rb
363
- - lib/airbrake/tasks.rb
364
373
  - lib/airbrake/tasks/airbrake.cap
374
+ - lib/airbrake/tasks.rb
365
375
  - lib/airbrake/user_informer.rb
366
376
  - lib/airbrake/utils/params_cleaner.rb
367
377
  - lib/airbrake/utils/rack_filters.rb
368
378
  - lib/airbrake/version.rb
379
+ - lib/airbrake.rb
369
380
  - lib/airbrake_tasks.rb
370
381
  - lib/rails/generators/airbrake/airbrake_generator.rb
371
- - lib/templates/javascript_notifier_configuration
372
- - lib/templates/javascript_notifier_loader
373
382
  - lib/templates/rescue.erb
374
383
  - rails/init.rb
375
- - resources/README.md
376
384
  - resources/airbrake_3_0.json
377
385
  - resources/ca-bundle.crt
378
386
  - resources/notice.xml
387
+ - resources/README.md
379
388
  - script/integration_test.rb
389
+ - airbrake.gemspec
390
+ - CHANGELOG
391
+ - Gemfile
392
+ - Guardfile
393
+ - INSTALL
394
+ - LICENSE
395
+ - Rakefile
396
+ - README_FOR_HEROKU_ADDON.md
397
+ - README.md
398
+ - TESTED_AGAINST
399
+ - install.rb
380
400
  - test/airbrake_tasks_test.rb
381
401
  - test/backtrace_test.rb
382
402
  - test/capistrano_test.rb
383
403
  - test/configuration_test.rb
384
404
  - test/controller_methods_test.rb
385
405
  - test/helper.rb
386
- - test/integration.rb
387
406
  - test/integration/catcher_test.rb
388
- - test/integration/javascript_notifier_test.rb
407
+ - test/integration.rb
389
408
  - test/logger_test.rb
390
409
  - test/notice_test.rb
391
410
  - test/notifier_test.rb
@@ -397,28 +416,46 @@ files:
397
416
  - test/sender_test.rb
398
417
  - test/support/response_shim.xml
399
418
  - test/user_informer_test.rb
419
+ - features/metal.feature
420
+ - features/rack.feature
421
+ - features/rails.feature
422
+ - features/rake.feature
423
+ - features/sinatra.feature
424
+ - features/step_definitions/file_steps.rb
425
+ - features/step_definitions/rack_steps.rb
426
+ - features/step_definitions/rails_application_steps.rb
427
+ - features/step_definitions/rake_steps.rb
428
+ - features/support/airbrake_shim.rb.template
429
+ - features/support/aruba.rb
430
+ - features/support/env.rb
431
+ - features/support/matchers.rb
432
+ - features/support/rails.rb
433
+ - features/support/rake/Rakefile
434
+ - features/user_informer.feature
435
+ - bin/airbrake
400
436
  homepage: http://www.airbrake.io
401
437
  licenses: []
402
- metadata: {}
403
438
  post_install_message:
404
439
  rdoc_options: []
405
440
  require_paths:
406
441
  - lib
407
442
  required_ruby_version: !ruby/object:Gem::Requirement
443
+ none: false
408
444
  requirements:
409
- - - '>='
445
+ - - ! '>='
410
446
  - !ruby/object:Gem::Version
411
447
  version: '0'
412
448
  required_rubygems_version: !ruby/object:Gem::Requirement
449
+ none: false
413
450
  requirements:
414
- - - '>='
451
+ - - ! '>='
415
452
  - !ruby/object:Gem::Version
416
453
  version: '0'
417
454
  requirements: []
418
455
  rubyforge_project:
419
- rubygems_version: 2.2.0
456
+ rubygems_version: 1.8.24
420
457
  signing_key:
421
- specification_version: 4
458
+ specification_version: 3
422
459
  summary: Send your application errors to our hosted service and reclaim your inbox.
423
460
  test_files:
424
461
  - test/airbrake_tasks_test.rb
@@ -428,7 +465,6 @@ test_files:
428
465
  - test/controller_methods_test.rb
429
466
  - test/helper.rb
430
467
  - test/integration/catcher_test.rb
431
- - test/integration/javascript_notifier_test.rb
432
468
  - test/integration.rb
433
469
  - test/logger_test.rb
434
470
  - test/notice_test.rb
@@ -444,7 +480,6 @@ test_files:
444
480
  - features/metal.feature
445
481
  - features/rack.feature
446
482
  - features/rails.feature
447
- - features/rails_with_js_notifier.feature
448
483
  - features/rake.feature
449
484
  - features/sinatra.feature
450
485
  - features/step_definitions/file_steps.rb
@@ -458,3 +493,4 @@ test_files:
458
493
  - features/support/rails.rb
459
494
  - features/support/rake/Rakefile
460
495
  - features/user_informer.feature
496
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: dfc2885576a30927690a4535d69e4ca351010c80
4
- data.tar.gz: d46ef484b70f08951c33fff46079c8a08317c2be
5
- SHA512:
6
- metadata.gz: 2194af5fb0d2c3610728f6ddcacc260aa366d6b30e4311c452ff8f54815f43b71aa05c632bef75d3ff447c40a2d45399393d40a4b21c09d30234db6ad3423def
7
- data.tar.gz: 736d7e758269212bbdbb0440c1aa8d436489f16de8813aa8b3778efad5ad0dbe9be69494514e9b18b20d1c07fa2a149af58630f24b22efb5ce229db3ad6d053d
@@ -1,104 +0,0 @@
1
- Feature: Install the Gem in a Rails application and enable the JavaScript notifier
2
-
3
- Background:
4
- Given I successfully run `rails new rails_root -O --skip-gemfile`
5
- And I cd to "rails_root"
6
- And I configure the Airbrake shim
7
-
8
- Scenario: Include the Javascript notifier when enabled
9
- When I configure the notifier to use the following configuration lines:
10
- """
11
- config.api_key = "myapikey"
12
- """
13
- And I define a response for "TestController#index":
14
- """
15
- render :inline => '<html><head profile="http://example.com"><%= airbrake_javascript_notifier %></head><body></body></html>'
16
- """
17
- And I route "/test/index" to "test#index"
18
- And I perform a request to "http://example.com:123/test/index" in the "production" environment
19
- Then I should see the notifier JavaScript for the following:
20
- | api_key | environment | host |
21
- | myapikey | production | api.airbrake.io |
22
- And the notifier JavaScript should provide the following errorDefaults:
23
- | url | component | action |
24
- | http://example.com:123/test/index | test | index |
25
-
26
- Scenario: Include the Javascript notifier when enabled using custom configuration settings
27
- When I configure the notifier to use the following configuration lines:
28
- """
29
- config.development_environments = []
30
- config.api_key = "myapikey!"
31
- config.host = "myairbrake.com"
32
- config.port = 3001
33
- """
34
- And I define a response for "TestController#index":
35
- """
36
- render :inline => '<html><head><%= airbrake_javascript_notifier %></head><body></body></html>'
37
- """
38
- And I route "/test/index" to "test#index"
39
- And I perform a request to "http://example.com:123/test/index"
40
- Then I should see the notifier JavaScript for the following:
41
- | api_key | environment | host |
42
- | myapikey! | test | myairbrake.com:3001 |
43
-
44
- Scenario: Don't include the Javascript notifier by default
45
- When I configure the notifier to use the following configuration lines:
46
- """
47
- config.api_key = "myapikey!"
48
- """
49
- And I define a response for "TestController#index":
50
- """
51
- render :inline => "<html><head></head><body></body></html>"
52
- """
53
- And I route "/test/index" to "test#index"
54
- And I perform a request to "http://example.com:123/test/index"
55
- Then I should not see notifier JavaScript
56
-
57
- Scenario: Don't include the Javascript notifier when enabled in non-public environments
58
- When I configure the notifier to use the following configuration lines:
59
- """
60
- config.api_key = "myapikey!"
61
- config.environment_name = 'test'
62
- """
63
- And I define a response for "TestController#index":
64
- """
65
- render :inline => '<html><head><%= airbrake_javascript_notifier %></head><body></body></html>'
66
- """
67
- And I route "/test/index" to "test#index"
68
- And I perform a request to "http://example.com:123/test/index" in the "test" environment
69
- Then I should not see notifier JavaScript
70
-
71
- Scenario: Use the js_api_key if present
72
- When I configure the notifier to use the following configuration lines:
73
- """
74
- config.api_key = "myapikey!"
75
- config.js_api_key = "myjsapikey!"
76
- """
77
- And I define a response for "TestController#index":
78
- """
79
- render :inline => '<html><head><%= airbrake_javascript_notifier %></head><body></body></html>'
80
- """
81
- And I route "/test/index" to "test#index"
82
- And I perform a request to "http://example.com:123/test/index" in the "production" environment
83
- Then I should see the notifier JavaScript for the following:
84
- | api_key | environment | host |
85
- | myjsapikey! | production | api.airbrake.io |
86
-
87
- Scenario: Being careful with user's instance variables
88
- When I configure the notifier to use the following configuration lines:
89
- """
90
- config.api_key = "myapikey"
91
- """
92
- And I define a response for "TestController#index":
93
- """
94
- @template = "this is some random instance variable"
95
- render :inline => '<html><head><%= airbrake_javascript_notifier %></head><body></body></html>'
96
- """
97
- And I route "/test/index" to "test#index"
98
- And I perform a request to "http://example.com:123/test/index" in the "production" environment
99
- Then I should see the notifier JavaScript for the following:
100
- | api_key | environment | host |
101
- | myapikey | production | api.airbrake.io |
102
- And the notifier JavaScript should provide the following errorDefaults:
103
- | url | component | action |
104
- | http://example.com:123/test/index | test | index |
@@ -1,83 +0,0 @@
1
- module Airbrake
2
- module Rails
3
- module JavascriptNotifier
4
- def self.included(base) #:nodoc:
5
- base.send :helper_method, :airbrake_javascript_notifier
6
- base.send :helper_method, :airbrake_javascript_loader
7
- base.send :helper_method, :airbrake_javascript_configuration
8
- end
9
-
10
- private
11
-
12
- def airbrake_javascript_notifier
13
- if Airbrake.configuration.public?
14
- airbrake_javascript_loader + airbrake_javascript_configuration
15
- end
16
- end
17
-
18
- def airbrake_javascript_loader
19
- if Airbrake.configuration.public?
20
- path = File.join File.dirname(__FILE__), '..', '..', 'templates', 'javascript_notifier_loader'
21
-
22
- _airbrake_render_part path
23
- end
24
- end
25
-
26
- def airbrake_javascript_configuration
27
- if Airbrake.configuration.public?
28
- path = File.join File.dirname(__FILE__), '..', '..', 'templates', 'javascript_notifier_configuration'
29
-
30
- options = {
31
- :api_key => Airbrake.configuration.js_api_key,
32
- :environment => Airbrake.configuration.environment_name,
33
- :action_name => action_name,
34
- :controller_name => controller_name,
35
- :url => request.url
36
- }
37
-
38
- _airbrake_render_part path, options
39
- end
40
- end
41
-
42
- protected
43
- attr_reader :template
44
-
45
- def _airbrake_render_part(path, locals={})
46
- locals[:host] = _airbrake_host
47
-
48
- options = {
49
- :file => path,
50
- :layout => false,
51
- :use_full_path => false,
52
- :handlers => [:erb],
53
- :locals => locals
54
- }
55
-
56
- result = _airbrake_render_template options
57
-
58
- if result.respond_to?(:html_safe)
59
- result.html_safe
60
- else
61
- result
62
- end
63
- end
64
-
65
- def _airbrake_render_template(options)
66
- case template
67
- when ActionView::Template
68
- template.render options
69
- else
70
- render_to_string options
71
- end
72
- end
73
-
74
- def _airbrake_host
75
- host = Airbrake.configuration.host.dup
76
- port = Airbrake.configuration.port
77
- host << ":#{port}" unless [80, 443].include?(port)
78
-
79
- host
80
- end
81
- end
82
- end
83
- end
@@ -1,12 +0,0 @@
1
- <%= javascript_tag %Q{
2
- try {
3
- window.Airbrake = (typeof(Airbrake) == 'undefined' && typeof(Hoptoad) != 'undefined') ? Hoptoad : Airbrake
4
- Airbrake.setKey('#{api_key}');
5
- Airbrake.setHost('#{host}');
6
- Airbrake.setEnvironment('#{environment}');
7
- Airbrake.setErrorDefaults({ url: "#{escape_javascript url}", component: "#{controller_name}", action: "#{action_name}" });
8
- } catch (e) {
9
- window.onerror = null;
10
- }
11
- }
12
- %>
@@ -1,6 +0,0 @@
1
- <%= javascript_tag %Q{
2
- (function(){
3
- var notifierJsScheme = (("https:" == document.location.protocol) ? "https://" : "http://");
4
- document.write(unescape("%3Cscript src='" + notifierJsScheme + "#{host}/javascripts/notifier.js' type='text/javascript'%3E%3C/script%3E"));
5
- })();
6
- }%>
@@ -1,56 +0,0 @@
1
- require 'airbrake/rails/javascript_notifier'
2
- require 'ostruct'
3
-
4
- class JavascriptNotifierTest < Test::Unit::TestCase
5
- module FakeRenderer
6
- def javascript_tag(text)
7
- "<script>#{text}</script>"
8
- end
9
- def escape_javascript(text)
10
- "ESC#{text}ESC"
11
- end
12
- end
13
-
14
- class FakeController
15
- def self.helper_method(*args)
16
- end
17
-
18
- include Airbrake::Rails::JavascriptNotifier
19
-
20
- def action_name
21
- "action"
22
- end
23
-
24
- def controller_name
25
- "controller"
26
- end
27
-
28
- def request
29
- @request ||= OpenStruct.new
30
- end
31
-
32
- def render_to_string(options)
33
- context = OpenStruct.new(options[:locals])
34
- context.extend(FakeRenderer)
35
- context.instance_eval do
36
- erb = ERB.new(IO.read(options[:file]))
37
- erb.result(binding)
38
- end
39
- end
40
- end
41
-
42
- should "make sure escape_javacript is called on the request.url" do
43
- Airbrake.configure do
44
- end
45
- controller = FakeController.new
46
- controller.request.url = "bad_javascript"
47
- assert controller.send(:airbrake_javascript_notifier)['"ESCbad_javascriptESC"']
48
- assert ! controller.send(:airbrake_javascript_notifier)['"bad_javascript"']
49
- end
50
-
51
- should "not raise exceptions for the non-public requests" do
52
- Airbrake::Configuration.any_instance.stubs(:public? => false)
53
- controller = FakeController.new
54
- assert_nothing_raised { controller.send(:airbrake_javascript_notifier) }
55
- end
56
- end