airbrake 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,22 @@
1
+ Version 3.1.1 - 2012-06-06 20:35:00 -0700
2
+ ===============================================================================
3
+
4
+ Hrvoje Šimić (10):
5
+ minor fixes for Rakefile
6
+ change color of user informer tests
7
+ remove unnecessary shim
8
+ use shim instead of server response in tests
9
+ add a note about informing the user
10
+ fix typo in Rakefile
11
+ valid mock responses
12
+ add a failing scenario for #92
13
+ 404s reporting fixed, closes #92
14
+ update mocks for rack and sinatra
15
+
16
+ Jonathan Siegel (1):
17
+ Updated copyright/trademarks
18
+
19
+
1
20
  Version 3.1.0 - 2012-05-28 02:25:09 +0200
2
21
  ===============================================================================
3
22
 
@@ -801,3 +820,4 @@ Nick Quaranto (3):
801
820
 
802
821
 
803
822
 
823
+
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ rescue LoadError
7
7
  $stderr.puts "Please install cucumber: `gem install cucumber`"
8
8
  exit 1
9
9
  end
10
+ require './lib/airbrake/version'
10
11
 
11
12
  FEATURES = ["sinatra","rack","metal","user_informer"]
12
13
 
@@ -170,7 +171,7 @@ end
170
171
  task :cucumber => [:vendor_test_gems]
171
172
 
172
173
 
173
- def run_rails_cucumbr_task(version, additional_cucumber_args)
174
+ def run_rails_cucumber_task(version, additional_cucumber_args)
174
175
  puts "Testing Rails #{version}"
175
176
  if version.empty?
176
177
  raise "No Rails version specified - make sure ENV['RAILS_VERSION'] is set, e.g. with `rake cucumber:rails:all`"
@@ -186,14 +187,14 @@ def define_rails_cucumber_tasks(additional_cucumber_args = '')
186
187
  RAILS_VERSIONS.each do |version|
187
188
  desc "Test integration of the gem with Rails #{version}"
188
189
  task version => [:vendor_test_gems] do
189
- exit 1 unless run_rails_cucumbr_task(version, additional_cucumber_args)
190
+ exit 1 unless run_rails_cucumber_task(version, additional_cucumber_args)
190
191
  end
191
192
  end
192
193
 
193
194
  desc "Test integration of the gem with all Rails versions"
194
195
  task :all do
195
196
  results = RAILS_VERSIONS.map do |version|
196
- run_rails_cucumbr_task(version, additional_cucumber_args)
197
+ run_rails_cucumber_task(version, additional_cucumber_args)
197
198
  end
198
199
 
199
200
  exit 1 unless results.all?
data/TESTING.md CHANGED
@@ -17,6 +17,11 @@ Then, to start the suite, run
17
17
  rake
18
18
  # NOT: bundle exec rake
19
19
 
20
+ Finally, this test suite runs against many rails versions. If you
21
+ prefer to run it against specific version hit
22
+
23
+ rake cucumber:rails:<VERSION>
24
+
20
25
 
21
26
  For Maintainers
22
27
  ================
@@ -19,5 +19,5 @@ Feature: Use the notifier in a plain Rack app
19
19
  end
20
20
  """
21
21
  When I perform a Rack request to "http://example.com:123/test/index?param=value"
22
- Then I should receive a Airbrake notification for rack
22
+ Then I should receive a Airbrake notification
23
23
 
@@ -2,10 +2,10 @@ Feature: Install the Gem in a Rails application
2
2
 
3
3
  Background:
4
4
  Given I have built and installed the "airbrake" gem
5
+ And I generate a new Rails application
5
6
 
6
7
  Scenario: Use the gem without vendoring the gem in a Rails application
7
- When I generate a new Rails application
8
- And I configure the Airbrake shim
8
+ When I configure the Airbrake shim
9
9
  And I configure my application to require the "airbrake" gem
10
10
  And I run the airbrake generator with "-k myapikey"
11
11
  Then the command should have run successfully
@@ -13,8 +13,7 @@ Feature: Install the Gem in a Rails application
13
13
  And I should see the Rails version
14
14
 
15
15
  Scenario: vendor the gem and uninstall
16
- When I generate a new Rails application
17
- And I configure the Airbrake shim
16
+ When I configure the Airbrake shim
18
17
  And I configure my application to require the "airbrake" gem
19
18
  And I unpack the "airbrake" gem
20
19
  And I run the airbrake generator with "-k myapikey"
@@ -26,18 +25,15 @@ Feature: Install the Gem in a Rails application
26
25
  And I should receive two Airbrake notifications
27
26
 
28
27
  Scenario: Configure the notifier by hand
29
- When I generate a new Rails application
30
- And I configure the Airbrake shim
28
+ When I configure the Airbrake shim
31
29
  And I configure the notifier to use "myapikey" as an API key
32
30
  And I configure my application to require the "airbrake" gem
33
31
  And I run the airbrake generator with ""
34
32
  Then I should receive a Airbrake notification
35
33
 
36
34
  Scenario: Configuration within initializer isn't overridden by Railtie
37
- When I generate a new Rails application
38
- And I configure the Airbrake shim
39
- And I configure my application to require the "airbrake" gem
40
- And I run the airbrake generator with "-k myapikey"
35
+ When I configure the Airbrake shim
36
+ And I configure usage of Airbrake
41
37
  Then the command should have run successfully
42
38
  When I configure the notifier to use the following configuration lines:
43
39
  """
@@ -54,14 +50,12 @@ Feature: Install the Gem in a Rails application
54
50
  Then I should receive a Airbrake notification
55
51
 
56
52
  Scenario: Try to install without an api key
57
- When I generate a new Rails application
58
- And I configure my application to require the "airbrake" gem
53
+ When I configure my application to require the "airbrake" gem
59
54
  And I run the airbrake generator with ""
60
55
  Then I should see "Must pass --api-key or --heroku or create config/initializers/airbrake.rb"
61
56
 
62
57
  Scenario: Configure and deploy using only installed gem
63
- When I generate a new Rails application
64
- And I run "capify ."
58
+ When I run "capify ."
65
59
  And I configure the Airbrake shim
66
60
  And I configure my application to require the "airbrake" gem
67
61
  And I run the airbrake generator with "-k myapikey"
@@ -70,8 +64,7 @@ Feature: Install the Gem in a Rails application
70
64
  Then I should see "airbrake:deploy"
71
65
 
72
66
  Scenario: Configure and deploy using only vendored gem
73
- When I generate a new Rails application
74
- And I run "capify ."
67
+ When I run "capify ."
75
68
  And I configure the Airbrake shim
76
69
  And I configure my application to require the "airbrake" gem
77
70
  And I unpack the "airbrake" gem
@@ -83,8 +76,7 @@ Feature: Install the Gem in a Rails application
83
76
  Then I should see "airbrake:deploy"
84
77
 
85
78
  Scenario: Try to install when the airbrake plugin still exists
86
- When I generate a new Rails application
87
- And I install the "airbrake" plugin
79
+ When I install the "airbrake" plugin
88
80
  And I configure the Airbrake shim
89
81
  And I configure the notifier to use "myapikey" as an API key
90
82
  And I configure my application to require the "airbrake" gem
@@ -92,10 +84,8 @@ Feature: Install the Gem in a Rails application
92
84
  Then I should see "You must first remove the airbrake plugin. Please run: script/plugin remove airbrake"
93
85
 
94
86
  Scenario: Rescue an exception in a controller
95
- When I generate a new Rails application
96
- And I configure the Airbrake shim
97
- And I configure my application to require the "airbrake" gem
98
- And I run the airbrake generator with "-k myapikey"
87
+ When I configure the Airbrake shim
88
+ And I configure usage of Airbrake
99
89
  And I define a response for "TestController#index":
100
90
  """
101
91
  session[:value] = "test"
@@ -106,16 +96,14 @@ Feature: Install the Gem in a Rails application
106
96
  Then I should receive a Airbrake notification
107
97
 
108
98
  Scenario: The gem should not be considered a framework gem
109
- When I generate a new Rails application
110
- And I configure the Airbrake shim
99
+ When I configure the Airbrake shim
111
100
  And I configure my application to require the "airbrake" gem
112
101
  And I run the airbrake generator with "-k myapikey"
113
102
  And I run "rake gems"
114
103
  Then I should see that "airbrake" is not considered a framework gem
115
104
 
116
105
  Scenario: The app uses Vlad instead of Capistrano
117
- When I generate a new Rails application
118
- And I configure the Airbrake shim
106
+ When I configure the Airbrake shim
119
107
  And I configure my application to require the "airbrake" gem
120
108
  And I run "touch config/deploy.rb"
121
109
  And I run "rm Capfile"
@@ -123,8 +111,7 @@ Feature: Install the Gem in a Rails application
123
111
  Then "config/deploy.rb" should not contain "capistrano"
124
112
 
125
113
  Scenario: Support the Heroku addon in the generator
126
- When I generate a new Rails application
127
- And I configure the Airbrake shim
114
+ When I configure the Airbrake shim
128
115
  And I configure the Heroku rake shim
129
116
  And I configure the Heroku gem shim with "myapikey"
130
117
  And I configure my application to require the "airbrake" gem
@@ -138,8 +125,7 @@ Feature: Install the Gem in a Rails application
138
125
  """
139
126
 
140
127
  Scenario: Support the --app option for the Heroku addon in the generator
141
- When I generate a new Rails application
142
- And I configure the Airbrake shim
128
+ When I configure the Airbrake shim
143
129
  And I configure the Heroku rake shim
144
130
  And I configure the Heroku gem shim with "myapikey" and multiple app support
145
131
  And I configure my application to require the "airbrake" gem
@@ -153,10 +139,8 @@ Feature: Install the Gem in a Rails application
153
139
  """
154
140
 
155
141
  Scenario: Filtering parameters in a controller
156
- When I generate a new Rails application
157
- And I configure the Airbrake shim
158
- And I configure my application to require the "airbrake" gem
159
- And I run the airbrake generator with "-k myapikey"
142
+ When I configure the Airbrake shim
143
+ And I configure usage of Airbrake
160
144
  When I configure the notifier to use the following configuration lines:
161
145
  """
162
146
  config.api_key = "myapikey"
@@ -172,10 +156,8 @@ Feature: Install the Gem in a Rails application
172
156
  Then I should receive a Airbrake notification
173
157
 
174
158
  Scenario: Filtering session in a controller
175
- When I generate a new Rails application
176
- And I configure the Airbrake shim
177
- And I configure my application to require the "airbrake" gem
178
- And I run the airbrake generator with "-k myapikey"
159
+ When I configure the Airbrake shim
160
+ And I configure usage of Airbrake
179
161
  When I configure the notifier to use the following configuration lines:
180
162
  """
181
163
  config.api_key = "myapikey"
@@ -191,10 +173,8 @@ Feature: Install the Gem in a Rails application
191
173
  Then I should receive a Airbrake notification
192
174
 
193
175
  Scenario: Filtering session and params based on Rails parameter filters
194
- When I generate a new Rails application
195
- And I configure the Airbrake shim
196
- And I configure my application to require the "airbrake" gem
197
- And I run the airbrake generator with "-k myapikey"
176
+ When I configure the Airbrake shim
177
+ And I configure usage of Airbrake
198
178
  And I configure the application to filter parameter "secret"
199
179
  And I define a response for "TestController#index":
200
180
  """
@@ -207,10 +187,8 @@ Feature: Install the Gem in a Rails application
207
187
  Then I should receive a Airbrake notification
208
188
 
209
189
  Scenario: Notify airbrake within the controller
210
- When I generate a new Rails application
211
- And I configure the Airbrake shim
212
- And I configure my application to require the "airbrake" gem
213
- And I run the airbrake generator with "-k myapikey"
190
+ When I configure the Airbrake shim
191
+ And I configure usage of Airbrake
214
192
  And I define a response for "TestController#index":
215
193
  """
216
194
  session[:value] = "test"
@@ -220,3 +198,10 @@ Feature: Install the Gem in a Rails application
220
198
  And I route "/test/index" to "test#index"
221
199
  And I perform a request to "http://example.com:123/test/index?param=value"
222
200
  Then I should receive a Airbrake notification
201
+
202
+ Scenario: Reporting 404s
203
+ When I configure the Airbrake shim
204
+ And I configure usage of Airbrake
205
+ And I perform a request to "http://example.com:123/this/route/does/not/exist"
206
+ And I should see "The page you were looking for doesn't exist."
207
+ And I should receive a Airbrake notification
@@ -25,5 +25,5 @@ Feature: Use the notifier in a Sinatra app
25
25
  app = FontaneApp
26
26
  """
27
27
  When I perform a Rack request to "http://example.com:123/test/index?param=value"
28
- Then I should receive a Airbrake notification for rack
28
+ Then I should receive a Airbrake notification
29
29
 
@@ -1,6 +1,10 @@
1
1
  require 'uri'
2
2
  require 'active_support/core_ext/string/inflections'
3
3
 
4
+ Given /^I have built and installed the "([^\"]*)" gem$/ do |gem_name|
5
+ @terminal.build_and_install_gem(File.join(PROJECT_ROOT, "#{gem_name}.gemspec"))
6
+ end
7
+
4
8
  When /^I generate a new Rails application$/ do
5
9
  @terminal.cd(TEMP_DIR)
6
10
 
@@ -48,9 +52,6 @@ Given /^I have installed the "([^\"]*)" gem$/ do |gem_name|
48
52
  @terminal.install_gem(gem_name)
49
53
  end
50
54
 
51
- Given /^I have built and installed the "([^\"]*)" gem$/ do |gem_name|
52
- @terminal.build_and_install_gem(File.join(PROJECT_ROOT, "#{gem_name}.gemspec"))
53
- end
54
55
 
55
56
  When /^I configure my application to require the "capistrano" gem if necessary$/ do
56
57
  When %{I configure my application to require the "capistrano" gem} if version_string >= "3.0.0"
@@ -423,3 +424,10 @@ Then /^I should not see notifier JavaScript$/ do
423
424
  response = Nokogiri::HTML.parse('<html>' + @terminal.output.split('<html>').last)
424
425
  response.at_css("script[type='text/javascript'][src$='/javascripts/notifier.js']").should be_nil
425
426
  end
427
+
428
+
429
+ When /^I configure usage of Airbrake$/ do
430
+ When %{I configure my application to require the "airbrake" gem}
431
+ When %{I run the airbrake generator with "-k myapikey"}
432
+ @terminal.flush! # flush the results of setting up Airbrake (generates notification)
433
+ end
@@ -120,7 +120,7 @@ module RailsHelpers
120
120
 
121
121
 
122
122
  env = Rack::MockRequest.env_for(#{uri.inspect})
123
- response = RailsRoot::Application.call(env).last
123
+ response = RailsRoot::Application.call(env)
124
124
 
125
125
  if response.is_a?(Array)
126
126
  puts response.join
@@ -60,6 +60,10 @@ class Terminal
60
60
  logger.debug(string)
61
61
  end
62
62
 
63
+ def flush!
64
+ @output = ""
65
+ end
66
+
63
67
  def build_and_install_gem(gemspec)
64
68
  pkg_dir = File.join(TEMP_DIR, 'pkg')
65
69
  FileUtils.mkdir_p(pkg_dir)
@@ -15,7 +15,9 @@ module Airbrake
15
15
 
16
16
  def render_exception_with_airbrake(env,exception)
17
17
  controller = env['action_controller.instance']
18
- env['airbrake.error_id'] = Airbrake.notify_or_ignore(exception, controller.airbrake_request_data) unless skip_user_agent?(env)
18
+ env['airbrake.error_id'] = Airbrake.
19
+ notify(exception,
20
+ controller.try(:airbrake_request_data) || :rack_env => env) unless skip_user_agent?(env)
19
21
  if defined?(controller.rescue_action_in_public_without_airbrake)
20
22
  controller.rescue_action_in_public_without_airbrake(exception)
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module Airbrake
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-03 00:00:00.000000000Z
12
+ date: 2012-06-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
16
- requirement: &70167650892280 !ruby/object:Gem::Requirement
16
+ requirement: &70339779074320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70167650892280
24
+ version_requirements: *70339779074320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &70167650891860 !ruby/object:Gem::Requirement
27
+ requirement: &70339779073820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70167650891860
35
+ version_requirements: *70339779073820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: actionpack
38
- requirement: &70167650891360 !ruby/object:Gem::Requirement
38
+ requirement: &70339779073120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.8
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70167650891360
46
+ version_requirements: *70339779073120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activerecord
49
- requirement: &70167650890840 !ruby/object:Gem::Requirement
49
+ requirement: &70339779071900 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.3.8
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70167650890840
57
+ version_requirements: *70339779071900
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: activesupport
60
- requirement: &70167650890380 !ruby/object:Gem::Requirement
60
+ requirement: &70339779071440 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.3.8
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70167650890380
68
+ version_requirements: *70339779071440
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bourne
71
- requirement: &70167650889900 !ruby/object:Gem::Requirement
71
+ requirement: &70339779070860 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '1.0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70167650889900
79
+ version_requirements: *70339779070860
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &70167650889440 !ruby/object:Gem::Requirement
82
+ requirement: &70339779070400 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.10.6
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70167650889440
90
+ version_requirements: *70339779070400
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: fakeweb
93
- requirement: &70167650888980 !ruby/object:Gem::Requirement
93
+ requirement: &70339779069940 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.3.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70167650888980
101
+ version_requirements: *70339779069940
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: nokogiri
104
- requirement: &70167650888520 !ruby/object:Gem::Requirement
104
+ requirement: &70339779069460 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 1.4.3.1
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70167650888520
112
+ version_requirements: *70339779069460
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
- requirement: &70167650888020 !ruby/object:Gem::Requirement
115
+ requirement: &70339779069000 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 2.6.0
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70167650888020
123
+ version_requirements: *70339779069000
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: sham_rack
126
- requirement: &70167650887500 !ruby/object:Gem::Requirement
126
+ requirement: &70339779068540 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 1.3.0
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70167650887500
134
+ version_requirements: *70339779068540
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: shoulda
137
- requirement: &70167650886880 !ruby/object:Gem::Requirement
137
+ requirement: &70339779068080 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 2.11.3
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70167650886880
145
+ version_requirements: *70339779068080
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: capistrano
148
- requirement: &70167650886040 !ruby/object:Gem::Requirement
148
+ requirement: &70339779067620 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ~>
@@ -153,7 +153,7 @@ dependencies:
153
153
  version: 2.8.0
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *70167650886040
156
+ version_requirements: *70339779067620
157
157
  description:
158
158
  email: support@airbrake.io
159
159
  executables: []