airbrake 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +91 -0
- data/Gemfile +7 -0
- data/Guardfile +6 -0
- data/README.md +21 -14
- data/SUPPORTED_RAILS_VERSIONS +0 -1
- data/lib/airbrake.rb +1 -1
- data/lib/airbrake/sender.rb +31 -21
- data/lib/airbrake/version.rb +1 -1
- data/test/helper.rb +14 -0
- data/test/logger_test.rb +0 -12
- data/test/notifier_test.rb +11 -0
- data/test/sender_test.rb +151 -98
- metadata +182 -108
data/CHANGELOG
CHANGED
@@ -1,3 +1,93 @@
|
|
1
|
+
Version 3.0.6 - Mon Dec 05 16:41:39 +0100 2011
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
Benjamin Quorning (1):
|
5
|
+
README updated to reflect name change from Hoptoad to Airbrake
|
6
|
+
|
7
|
+
Darcy Laycock (1):
|
8
|
+
Explicitly scope calls to Rails.env and such to prevent loading issues when manually requiring parts of airbrake.
|
9
|
+
|
10
|
+
David (1):
|
11
|
+
Merge pull request #42 from Playhem/fix-issue-34-cherrypicked
|
12
|
+
|
13
|
+
David Czarnecki (6):
|
14
|
+
Using the Capistrano logger for great justice
|
15
|
+
Using the Capistrano logger for great justice
|
16
|
+
Re-organized capistrano task to allow for testing
|
17
|
+
Fixing conflict
|
18
|
+
Fixed the name of the capistrano task in the test to be correct. Updated the cucumber feature to look for the right task name.
|
19
|
+
Change airbrake:notify to airbrake:deploy to be more clear that it is a deploy notification
|
20
|
+
|
21
|
+
David Palm (8):
|
22
|
+
Removes support for Rails v2.3.12
|
23
|
+
Documentation glitch
|
24
|
+
Documenting workaround for issue #39
|
25
|
+
Using guard&spork for testing
|
26
|
+
Adding Guardfile
|
27
|
+
Moves #assert_logged to test helper
|
28
|
+
Moves http setup code to own method
|
29
|
+
Not sporking yet
|
30
|
+
|
31
|
+
Florent Guilleux (1):
|
32
|
+
Change Hoptoad references to Airbrake.
|
33
|
+
|
34
|
+
Gabe Berke-Williams (1):
|
35
|
+
Merge pull request #10 from Florent2/patch-1
|
36
|
+
|
37
|
+
Harold Giménez (10):
|
38
|
+
Heroku is still using HOPTOAD_API_KEY, so expect that for now
|
39
|
+
Bumping to version 3.0
|
40
|
+
Bumping to version 3.0.1
|
41
|
+
Fix bug in defining the Airbrake javascript object
|
42
|
+
Bumping to version 3.0.2
|
43
|
+
Ensure a valid configuration object is always available on Airbrake.configuration
|
44
|
+
Merge remote-tracking branch 'agoragames/master'
|
45
|
+
Bumping to version 3.0.3
|
46
|
+
Minor fix to Gemfile instructions on README
|
47
|
+
Bumping to version 3.0.4
|
48
|
+
|
49
|
+
Jonathan Siegel (16):
|
50
|
+
Removed class-level caching per jkraemer: Hi,
|
51
|
+
Integrated pulls and updated tests.
|
52
|
+
Integrated: https://github.com/thoughtbot/hoptoad_notifier/pull/37
|
53
|
+
Corrected test.
|
54
|
+
Consistent operation.
|
55
|
+
Consistent callout during test generation.
|
56
|
+
Fixed typo.
|
57
|
+
Refreshed supported.
|
58
|
+
Resolved: http://help.airbrakeapp.com/discussions/questions/587-airbrake_javascript_notifier-is-escaped-rails-31-haml
|
59
|
+
Now running airbrake deploy notifications on the REMOTE machine.
|
60
|
+
Added first rev of PEER cert resolution.
|
61
|
+
Bumped 3.0.5
|
62
|
+
Updated README, fixed JS rescue template missed HT reference.
|
63
|
+
Crosslinked docs...
|
64
|
+
Fixes for tests.
|
65
|
+
Bumping to version 3.0.5
|
66
|
+
|
67
|
+
Leonid Shevtsov (3):
|
68
|
+
fixed rake handler failing when exception happens before Airbrake has been configured (for example, when running an unknown Rake task)
|
69
|
+
fix issue #34 'undefined method to_backtrace for Hash'
|
70
|
+
test case for issue #34
|
71
|
+
|
72
|
+
Matt Fawcett (1):
|
73
|
+
Call #close on the old body after building the new body to prevent thread joining errors
|
74
|
+
|
75
|
+
Roman Shterenzon (1):
|
76
|
+
Use either Airbrake or Hoptoad object.
|
77
|
+
|
78
|
+
Stuart Chaney (1):
|
79
|
+
point towards airbrake.io
|
80
|
+
|
81
|
+
Thomas Jachmann (1):
|
82
|
+
handles exceptions with #to_hash properly
|
83
|
+
|
84
|
+
usiegj00 (4):
|
85
|
+
Merge pull request #21 from mattfawcett/master
|
86
|
+
Merge pull request #12 from leonid-shevtsov/master
|
87
|
+
Merge pull request #14 from thomasjachmann/master
|
88
|
+
Merge pull request #28 from Sutto/patch-1
|
89
|
+
|
90
|
+
|
1
91
|
Version 3.0.5 - 2011-11-08 23:02:07 -0800
|
2
92
|
===============================================================================
|
3
93
|
|
@@ -520,3 +610,4 @@ Nick Quaranto (3):
|
|
520
610
|
Adding rake changeling:push
|
521
611
|
|
522
612
|
|
613
|
+
|
data/Gemfile
CHANGED
data/Guardfile
ADDED
data/README.md
CHANGED
@@ -43,7 +43,7 @@ Add the airbrake gem to your Gemfile. In Gemfile:
|
|
43
43
|
Then from your project's RAILS_ROOT, and in your development environment, run:
|
44
44
|
|
45
45
|
bundle install
|
46
|
-
|
46
|
+
rails generate airbrake --api-key your_key_here
|
47
47
|
|
48
48
|
That's it!
|
49
49
|
|
@@ -125,7 +125,7 @@ You can then continue to install normally. If you don't remove the rake file,
|
|
125
125
|
you will be unable to unpack this gem (Rails will think it's part of the
|
126
126
|
framework).
|
127
127
|
|
128
|
-
|
128
|
+
|
129
129
|
|
130
130
|
You can test that Airbrake is working in your production environment by using
|
131
131
|
this rake task (from RAILS_ROOT):
|
@@ -135,6 +135,18 @@ this rake task (from RAILS_ROOT):
|
|
135
135
|
If everything is configured properly, that task will send a notice to Airbrake
|
136
136
|
which will be visible immediately.
|
137
137
|
|
138
|
+
|
139
|
+
Non-rails apps using Bundler
|
140
|
+
----------------------------
|
141
|
+
There is an undocumented dependency in `activesupport` where the `i18n` gem is
|
142
|
+
required only if the core classes extensions are used (`active_support/core_ext`).
|
143
|
+
This can lead to a confusing `LoadError` exception when using Airbrake. Until
|
144
|
+
this is fixed in `activesupport` the workaround is to add `i18n` to the Gemfile
|
145
|
+
for your Sinatra/Rack/pure ruby application:
|
146
|
+
|
147
|
+
gem 'i18n'
|
148
|
+
gem 'airbrake'
|
149
|
+
|
138
150
|
Rack
|
139
151
|
----
|
140
152
|
|
@@ -157,23 +169,19 @@ middleware:
|
|
157
169
|
Sinatra
|
158
170
|
-------
|
159
171
|
|
160
|
-
Using airbrake in a Sinatra app is just like a Rack app
|
161
|
-
to disable Sinatra's error rescuing functionality:
|
172
|
+
Using airbrake in a Sinatra app is just like a Rack app:
|
162
173
|
|
163
|
-
require 'sinatra
|
174
|
+
require 'sinatra'
|
164
175
|
require 'airbrake'
|
165
176
|
|
166
177
|
Airbrake.configure do |config|
|
167
|
-
config.api_key = '
|
178
|
+
config.api_key = 'my api key'
|
168
179
|
end
|
169
180
|
|
170
|
-
|
171
|
-
use Airbrake::Rack
|
172
|
-
enable :raise_errors
|
181
|
+
use Airbrake::Rack
|
173
182
|
|
174
|
-
|
175
|
-
|
176
|
-
end
|
183
|
+
get '/' do
|
184
|
+
raise "Sinatra has left the building"
|
177
185
|
end
|
178
186
|
|
179
187
|
Usage
|
@@ -317,8 +325,7 @@ configuration block.
|
|
317
325
|
config.ignore << "ActiveRecord::IgnoreThisError"
|
318
326
|
end
|
319
327
|
|
320
|
-
To ignore *only* certain errors (and override the defaults), use the
|
321
|
-
#ignore_only attribute.
|
328
|
+
To ignore *only* certain errors (and override the defaults), use the #ignore_only attribute.
|
322
329
|
|
323
330
|
Airbrake.configure do |config|
|
324
331
|
config.api_key = '1234567890abcdef'
|
data/SUPPORTED_RAILS_VERSIONS
CHANGED
data/lib/airbrake.rb
CHANGED
@@ -137,7 +137,7 @@ module Airbrake
|
|
137
137
|
|
138
138
|
def build_notice_for(exception, opts = {})
|
139
139
|
exception = unwrap_exception(exception)
|
140
|
-
opts = opts.merge(:exception => exception)
|
140
|
+
opts = opts.merge(:exception => exception) if exception.is_a?(Exception)
|
141
141
|
opts = opts.merge(exception.to_hash) if exception.respond_to?(:to_hash)
|
142
142
|
Notice.new(configuration.merge(opts))
|
143
143
|
end
|
data/lib/airbrake/sender.rb
CHANGED
@@ -23,27 +23,7 @@ module Airbrake
|
|
23
23
|
#
|
24
24
|
# @param [String] data The XML notice to be sent off
|
25
25
|
def send_to_airbrake(data)
|
26
|
-
|
27
|
-
|
28
|
-
http =
|
29
|
-
Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass).
|
30
|
-
new(url.host, url.port)
|
31
|
-
|
32
|
-
http.read_timeout = http_read_timeout
|
33
|
-
http.open_timeout = http_open_timeout
|
34
|
-
|
35
|
-
if secure
|
36
|
-
http.use_ssl = true
|
37
|
-
if File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
|
38
|
-
http.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
|
39
|
-
else
|
40
|
-
# ca-bundle.crt built from source, see resources/README.md
|
41
|
-
http.ca_file = Sender.local_cert_path
|
42
|
-
end
|
43
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
44
|
-
else
|
45
|
-
http.use_ssl = false
|
46
|
-
end
|
26
|
+
http = setup_http_connection
|
47
27
|
|
48
28
|
response = begin
|
49
29
|
http.post(url.path, data, HEADERS)
|
@@ -63,6 +43,9 @@ module Airbrake
|
|
63
43
|
error_id = response.body.match(%r{<error-id[^>]*>(.*?)</error-id>})
|
64
44
|
error_id[1] if error_id
|
65
45
|
end
|
46
|
+
rescue => e
|
47
|
+
log :error, "[Airbrake::Sender#send_to_airbrake] Cannot send notification. Error: #{e.class} - #{e.message}\nBacktrace:\n#{e.backtrace.join("\n\t")}"
|
48
|
+
nil
|
66
49
|
end
|
67
50
|
|
68
51
|
|
@@ -90,6 +73,33 @@ module Airbrake
|
|
90
73
|
def logger
|
91
74
|
Airbrake.logger
|
92
75
|
end
|
76
|
+
|
77
|
+
def setup_http_connection
|
78
|
+
http =
|
79
|
+
Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass).
|
80
|
+
new(url.host, url.port)
|
81
|
+
|
82
|
+
http.read_timeout = http_read_timeout
|
83
|
+
http.open_timeout = http_open_timeout
|
84
|
+
|
85
|
+
if secure
|
86
|
+
http.use_ssl = true
|
87
|
+
if File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
|
88
|
+
http.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
|
89
|
+
else
|
90
|
+
# ca-bundle.crt built from source, see resources/README.md
|
91
|
+
http.ca_file = Sender.local_cert_path
|
92
|
+
end
|
93
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
94
|
+
else
|
95
|
+
http.use_ssl = false
|
96
|
+
end
|
97
|
+
|
98
|
+
http
|
99
|
+
rescue => e
|
100
|
+
log :error, "[Airbrake::Sender#setup_http_connection] Failure initializing the HTTP connection.\nError: #{e.class} - #{e.message}\nBacktrace:\n#{e.backtrace.join("\n\t")}"
|
101
|
+
raise e
|
102
|
+
end
|
93
103
|
|
94
104
|
end
|
95
105
|
end
|
data/lib/airbrake/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -189,6 +189,20 @@ class Test::Unit::TestCase
|
|
189
189
|
"but found #{nodes.map { |n| n.content }} in #{nodes.size} matching nodes." +
|
190
190
|
"Document:\n#{document.to_s}"
|
191
191
|
end
|
192
|
+
|
193
|
+
def assert_logged(expected)
|
194
|
+
assert_received(Airbrake, :write_verbose_log) do |expect|
|
195
|
+
expect.with {|actual| actual =~ expected }
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
def assert_not_logged(expected)
|
200
|
+
assert_received(Airbrake, :write_verbose_log) do |expect|
|
201
|
+
expect.with {|actual| actual =~ expected }.never
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
|
192
206
|
end
|
193
207
|
|
194
208
|
module DefinesConstants
|
data/test/logger_test.rb
CHANGED
@@ -18,18 +18,6 @@ class LoggerTest < Test::Unit::TestCase
|
|
18
18
|
Airbrake.stubs(:write_verbose_log)
|
19
19
|
end
|
20
20
|
|
21
|
-
def assert_logged(expected)
|
22
|
-
assert_received(Airbrake, :write_verbose_log) do |expect|
|
23
|
-
expect.with {|actual| actual =~ expected }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def assert_not_logged(expected)
|
28
|
-
assert_received(Airbrake, :write_verbose_log) do |expect|
|
29
|
-
expect.with {|actual| actual =~ expected }.never
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
21
|
def configure
|
34
22
|
Airbrake.configure { |config| }
|
35
23
|
end
|
data/test/notifier_test.rb
CHANGED
@@ -82,6 +82,17 @@ class NotifierTest < Test::Unit::TestCase
|
|
82
82
|
assert_sent(notice, notice_args)
|
83
83
|
end
|
84
84
|
|
85
|
+
should "not pass the hash as an exception when sending a notice for it" do
|
86
|
+
set_public_env
|
87
|
+
notice = stub_notice!
|
88
|
+
notice_args = { :error_message => 'uh oh' }
|
89
|
+
stub_sender!
|
90
|
+
|
91
|
+
Airbrake.notify(notice_args)
|
92
|
+
|
93
|
+
assert_received(Airbrake::Notice, :new) {|expect| expect.with(Not(has_key(:exception))) }
|
94
|
+
end
|
95
|
+
|
85
96
|
should "create and send a notice for an exception that responds to to_hash" do
|
86
97
|
set_public_env
|
87
98
|
exception = build_exception
|
data/test/sender_test.rb
CHANGED
@@ -64,130 +64,183 @@ class SenderTest < Test::Unit::TestCase
|
|
64
64
|
assert_equal "3799307", send_exception(:secure => false)
|
65
65
|
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
67
|
+
context "exceptions" do
|
68
|
+
context "HTTP connection setup problems" do
|
69
|
+
should "not be rescued" do
|
70
|
+
http = stub(:new => NoMemoryError.new)
|
71
|
+
proxy = stub(:new => http)
|
72
|
+
Net::HTTP.stubs(:Proxy => proxy)
|
73
|
+
|
74
|
+
assert_raise do
|
75
|
+
build_sender.send(:setup_http_connection)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
should "be logged" do
|
80
|
+
http = stub(:new => NoMemoryError.new)
|
81
|
+
proxy = stub(:new => http)
|
82
|
+
Net::HTTP.stubs(:Proxy => proxy)
|
83
|
+
|
84
|
+
sender = build_sender
|
85
|
+
|
86
|
+
assert_raise do
|
87
|
+
sender.expects(:log).with(:error, includes('Failure initializing the HTTP connection'))
|
88
|
+
|
89
|
+
sender.send(:setup_http_connection)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context "unexpected exception sending problems" do
|
95
|
+
should "be logged" do
|
96
|
+
sender = build_sender
|
97
|
+
sender.stubs(:setup_http_connection).raises(RuntimeError.new)
|
98
|
+
|
99
|
+
sender.expects(:log).with(:error, includes('Cannot send notification. Error'))
|
100
|
+
sender.send_to_airbrake("stuff")
|
101
|
+
end
|
102
|
+
|
103
|
+
should "return nil no matter what" do
|
104
|
+
sender = build_sender
|
105
|
+
sender.stubs(:setup_http_connection).raises(SystemExit.new)
|
106
|
+
|
107
|
+
assert_nothing_thrown do
|
108
|
+
assert_nil sender.send_to_airbrake("stuff")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
should "return nil on failed posting" do
|
114
|
+
http = stub_http
|
115
|
+
http.stubs(:post).raises(Errno::ECONNREFUSED)
|
116
|
+
assert_equal nil, send_exception(:secure => false)
|
78
117
|
end
|
79
|
-
end
|
80
118
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
119
|
+
should "not fail when posting and a timeout exception occurs" do
|
120
|
+
http = stub_http
|
121
|
+
http.stubs(:post).raises(TimeoutError)
|
122
|
+
assert_nothing_thrown do
|
123
|
+
send_exception(:secure => false)
|
124
|
+
end
|
86
125
|
end
|
87
|
-
end
|
88
126
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
http.stubs(:post).raises(error)
|
127
|
+
should "not fail when posting and a connection refused exception occurs" do
|
128
|
+
http = stub_http
|
129
|
+
http.stubs(:post).raises(Errno::ECONNREFUSED)
|
93
130
|
assert_nothing_thrown do
|
94
131
|
send_exception(:secure => false)
|
95
132
|
end
|
96
133
|
end
|
97
|
-
end
|
98
134
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
135
|
+
should "not fail when posting any http exception occurs" do
|
136
|
+
http = stub_http
|
137
|
+
Airbrake::Sender::HTTP_ERRORS.each do |error|
|
138
|
+
http.stubs(:post).raises(error)
|
139
|
+
assert_nothing_thrown do
|
140
|
+
send_exception(:secure => false)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
105
144
|
end
|
106
145
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
146
|
+
context "SSL" do
|
147
|
+
should "post to the right url for non-ssl" do
|
148
|
+
http = stub_http
|
149
|
+
url = "http://airbrake.io:80#{Airbrake::Sender::NOTICES_URI}"
|
150
|
+
uri = URI.parse(url)
|
151
|
+
send_exception(:secure => false)
|
152
|
+
assert_received(http, :post) {|expect| expect.with(uri.path, anything, Airbrake::HEADERS) }
|
153
|
+
end
|
112
154
|
|
113
|
-
|
114
|
-
|
115
|
-
|
155
|
+
should "post to the right path for ssl" do
|
156
|
+
http = stub_http
|
157
|
+
send_exception(:secure => true)
|
158
|
+
assert_received(http, :post) {|expect| expect.with(Airbrake::Sender::NOTICES_URI, anything, Airbrake::HEADERS) }
|
159
|
+
end
|
116
160
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
Net::HTTP.stubs(:Proxy => proxy)
|
121
|
-
File.stubs(:exist?).with(OpenSSL::X509::DEFAULT_CERT_FILE).returns(false)
|
161
|
+
should "verify the SSL peer when the use_ssl option is set to true" do
|
162
|
+
url = "https://airbrake.io#{Airbrake::Sender::NOTICES_URI}"
|
163
|
+
uri = URI.parse(url)
|
122
164
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
165
|
+
real_http = Net::HTTP.new(uri.host, uri.port)
|
166
|
+
real_http.stubs(:post => nil)
|
167
|
+
proxy = stub(:new => real_http)
|
168
|
+
Net::HTTP.stubs(:Proxy => proxy)
|
169
|
+
File.stubs(:exist?).with(OpenSSL::X509::DEFAULT_CERT_FILE).returns(false)
|
128
170
|
|
129
|
-
|
130
|
-
|
131
|
-
|
171
|
+
send_exception(:secure => true)
|
172
|
+
assert(real_http.use_ssl?)
|
173
|
+
assert_equal(OpenSSL::SSL::VERIFY_PEER, real_http.verify_mode)
|
174
|
+
assert_equal(Airbrake::Sender.local_cert_path, real_http.ca_file)
|
175
|
+
end
|
132
176
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
Net::HTTP.stubs(:Proxy => proxy)
|
137
|
-
File.stubs(:exist?).with(OpenSSL::X509::DEFAULT_CERT_FILE).returns(true)
|
177
|
+
should "verify the SSL peer when the use_ssl option is set to true and the default cert exists" do
|
178
|
+
url = "https://airbrake.io#{Airbrake::Sender::NOTICES_URI}"
|
179
|
+
uri = URI.parse(url)
|
138
180
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
181
|
+
real_http = Net::HTTP.new(uri.host, uri.port)
|
182
|
+
real_http.stubs(:post => nil)
|
183
|
+
proxy = stub(:new => real_http)
|
184
|
+
Net::HTTP.stubs(:Proxy => proxy)
|
185
|
+
File.stubs(:exist?).with(OpenSSL::X509::DEFAULT_CERT_FILE).returns(true)
|
144
186
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
187
|
+
send_exception(:secure => true)
|
188
|
+
assert(real_http.use_ssl?)
|
189
|
+
assert_equal(OpenSSL::SSL::VERIFY_PEER, real_http.verify_mode)
|
190
|
+
assert_equal(OpenSSL::X509::DEFAULT_CERT_FILE, real_http.ca_file)
|
191
|
+
end
|
192
|
+
|
193
|
+
should "connect to the right port for ssl" do
|
194
|
+
stub_http
|
195
|
+
send_exception(:secure => true)
|
196
|
+
assert_received(Net::HTTP, :new) {|expect| expect.with("airbrake.io", 443) }
|
197
|
+
end
|
150
198
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
199
|
+
should "connect to the right port for non-ssl" do
|
200
|
+
stub_http
|
201
|
+
send_exception(:secure => false)
|
202
|
+
assert_received(Net::HTTP, :new) {|expect| expect.with("airbrake.io", 80) }
|
203
|
+
end
|
156
204
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
205
|
+
should "use ssl if secure" do
|
206
|
+
stub_http
|
207
|
+
send_exception(:secure => true, :host => 'example.org')
|
208
|
+
assert_received(Net::HTTP, :new) {|expect| expect.with('example.org', 443) }
|
209
|
+
end
|
162
210
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
211
|
+
should "not use ssl if not secure" do
|
212
|
+
stub_http
|
213
|
+
send_exception(:secure => false, :host => 'example.org')
|
214
|
+
assert_received(Net::HTTP, :new) {|expect| expect.with('example.org', 80) }
|
215
|
+
end
|
168
216
|
|
169
|
-
|
170
|
-
stub_http
|
171
|
-
send_exception(:secure => true)
|
172
|
-
assert_received(Net::HTTP, :new) {|expect| expect.with("airbrake.io", 443) }
|
217
|
+
|
173
218
|
end
|
219
|
+
|
220
|
+
context "network timeouts" do
|
221
|
+
should "default the open timeout to 2 seconds" do
|
222
|
+
http = stub_http
|
223
|
+
send_exception
|
224
|
+
assert_received(http, :open_timeout=) {|expect| expect.with(2) }
|
225
|
+
end
|
174
226
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
227
|
+
should "default the read timeout to 5 seconds" do
|
228
|
+
http = stub_http
|
229
|
+
send_exception
|
230
|
+
assert_received(http, :read_timeout=) {|expect| expect.with(5) }
|
231
|
+
end
|
180
232
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
233
|
+
should "allow override of the open timeout" do
|
234
|
+
http = stub_http
|
235
|
+
send_exception(:http_open_timeout => 4)
|
236
|
+
assert_received(http, :open_timeout=) {|expect| expect.with(4) }
|
237
|
+
end
|
186
238
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
239
|
+
should "allow override of the read timeout" do
|
240
|
+
http = stub_http
|
241
|
+
send_exception(:http_read_timeout => 10)
|
242
|
+
assert_received(http, :read_timeout=) {|expect| expect.with(10) }
|
243
|
+
end
|
191
244
|
end
|
192
245
|
|
193
246
|
end
|
metadata
CHANGED
@@ -1,169 +1,240 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 6
|
10
|
+
version: 3.0.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- thoughtbot, inc
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-12-06 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: builder
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
22
32
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
26
35
|
name: activesupport
|
27
|
-
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
38
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
33
46
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
37
49
|
name: actionpack
|
38
|
-
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
52
|
none: false
|
40
|
-
requirements:
|
53
|
+
requirements:
|
41
54
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 19
|
57
|
+
segments:
|
58
|
+
- 2
|
59
|
+
- 3
|
60
|
+
- 8
|
43
61
|
version: 2.3.8
|
44
62
|
type: :development
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
48
65
|
name: activerecord
|
49
|
-
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
68
|
none: false
|
51
|
-
requirements:
|
69
|
+
requirements:
|
52
70
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 19
|
73
|
+
segments:
|
74
|
+
- 2
|
75
|
+
- 3
|
76
|
+
- 8
|
54
77
|
version: 2.3.8
|
55
78
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
59
81
|
name: activesupport
|
60
|
-
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
84
|
none: false
|
62
|
-
requirements:
|
85
|
+
requirements:
|
63
86
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 19
|
89
|
+
segments:
|
90
|
+
- 2
|
91
|
+
- 3
|
92
|
+
- 8
|
65
93
|
version: 2.3.8
|
66
94
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: *id005
|
96
|
+
- !ruby/object:Gem::Dependency
|
70
97
|
name: bourne
|
71
|
-
|
98
|
+
prerelease: false
|
99
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
100
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 15
|
105
|
+
segments:
|
106
|
+
- 1
|
107
|
+
- 0
|
108
|
+
version: "1.0"
|
77
109
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
81
112
|
name: cucumber
|
82
|
-
|
113
|
+
prerelease: false
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
115
|
none: false
|
84
|
-
requirements:
|
116
|
+
requirements:
|
85
117
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 59
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
- 10
|
123
|
+
- 6
|
87
124
|
version: 0.10.6
|
88
125
|
type: :development
|
89
|
-
|
90
|
-
|
91
|
-
- !ruby/object:Gem::Dependency
|
126
|
+
version_requirements: *id007
|
127
|
+
- !ruby/object:Gem::Dependency
|
92
128
|
name: fakeweb
|
93
|
-
|
129
|
+
prerelease: false
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
94
131
|
none: false
|
95
|
-
requirements:
|
132
|
+
requirements:
|
96
133
|
- - ~>
|
97
|
-
- !ruby/object:Gem::Version
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 27
|
136
|
+
segments:
|
137
|
+
- 1
|
138
|
+
- 3
|
139
|
+
- 0
|
98
140
|
version: 1.3.0
|
99
141
|
type: :development
|
100
|
-
|
101
|
-
|
102
|
-
- !ruby/object:Gem::Dependency
|
142
|
+
version_requirements: *id008
|
143
|
+
- !ruby/object:Gem::Dependency
|
103
144
|
name: nokogiri
|
104
|
-
|
145
|
+
prerelease: false
|
146
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
105
147
|
none: false
|
106
|
-
requirements:
|
148
|
+
requirements:
|
107
149
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
hash: 113
|
152
|
+
segments:
|
153
|
+
- 1
|
154
|
+
- 4
|
155
|
+
- 3
|
156
|
+
- 1
|
109
157
|
version: 1.4.3.1
|
110
158
|
type: :development
|
111
|
-
|
112
|
-
|
113
|
-
- !ruby/object:Gem::Dependency
|
159
|
+
version_requirements: *id009
|
160
|
+
- !ruby/object:Gem::Dependency
|
114
161
|
name: rspec
|
115
|
-
|
162
|
+
prerelease: false
|
163
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
116
164
|
none: false
|
117
|
-
requirements:
|
165
|
+
requirements:
|
118
166
|
- - ~>
|
119
|
-
- !ruby/object:Gem::Version
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
hash: 23
|
169
|
+
segments:
|
170
|
+
- 2
|
171
|
+
- 6
|
172
|
+
- 0
|
120
173
|
version: 2.6.0
|
121
174
|
type: :development
|
122
|
-
|
123
|
-
|
124
|
-
- !ruby/object:Gem::Dependency
|
175
|
+
version_requirements: *id010
|
176
|
+
- !ruby/object:Gem::Dependency
|
125
177
|
name: sham_rack
|
126
|
-
|
178
|
+
prerelease: false
|
179
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
127
180
|
none: false
|
128
|
-
requirements:
|
181
|
+
requirements:
|
129
182
|
- - ~>
|
130
|
-
- !ruby/object:Gem::Version
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
hash: 27
|
185
|
+
segments:
|
186
|
+
- 1
|
187
|
+
- 3
|
188
|
+
- 0
|
131
189
|
version: 1.3.0
|
132
190
|
type: :development
|
133
|
-
|
134
|
-
|
135
|
-
- !ruby/object:Gem::Dependency
|
191
|
+
version_requirements: *id011
|
192
|
+
- !ruby/object:Gem::Dependency
|
136
193
|
name: shoulda
|
137
|
-
|
194
|
+
prerelease: false
|
195
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
138
196
|
none: false
|
139
|
-
requirements:
|
197
|
+
requirements:
|
140
198
|
- - ~>
|
141
|
-
- !ruby/object:Gem::Version
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
hash: 37
|
201
|
+
segments:
|
202
|
+
- 2
|
203
|
+
- 11
|
204
|
+
- 3
|
142
205
|
version: 2.11.3
|
143
206
|
type: :development
|
144
|
-
|
145
|
-
|
146
|
-
- !ruby/object:Gem::Dependency
|
207
|
+
version_requirements: *id012
|
208
|
+
- !ruby/object:Gem::Dependency
|
147
209
|
name: capistrano
|
148
|
-
|
210
|
+
prerelease: false
|
211
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
149
212
|
none: false
|
150
|
-
requirements:
|
213
|
+
requirements:
|
151
214
|
- - ~>
|
152
|
-
- !ruby/object:Gem::Version
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
hash: 47
|
217
|
+
segments:
|
218
|
+
- 2
|
219
|
+
- 8
|
220
|
+
- 0
|
153
221
|
version: 2.8.0
|
154
222
|
type: :development
|
155
|
-
|
156
|
-
version_requirements: *70183356305220
|
223
|
+
version_requirements: *id013
|
157
224
|
description:
|
158
225
|
email: support@airbrake.io
|
159
226
|
executables: []
|
227
|
+
|
160
228
|
extensions: []
|
229
|
+
|
161
230
|
extra_rdoc_files: []
|
162
|
-
|
231
|
+
|
232
|
+
files:
|
163
233
|
- .gitignore
|
164
234
|
- .yardopts
|
165
235
|
- CHANGELOG
|
166
236
|
- Gemfile
|
237
|
+
- Guardfile
|
167
238
|
- INSTALL
|
168
239
|
- MIT-LICENSE
|
169
240
|
- README.md
|
@@ -243,35 +314,38 @@ files:
|
|
243
314
|
- test/user_informer_test.rb
|
244
315
|
homepage: http://www.airbrake.io
|
245
316
|
licenses: []
|
317
|
+
|
246
318
|
post_install_message:
|
247
319
|
rdoc_options: []
|
248
|
-
|
320
|
+
|
321
|
+
require_paths:
|
249
322
|
- lib
|
250
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
323
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
251
324
|
none: false
|
252
|
-
requirements:
|
253
|
-
- -
|
254
|
-
- !ruby/object:Gem::Version
|
255
|
-
|
256
|
-
segments:
|
325
|
+
requirements:
|
326
|
+
- - ">="
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
hash: 3
|
329
|
+
segments:
|
257
330
|
- 0
|
258
|
-
|
259
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
|
+
version: "0"
|
332
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
333
|
none: false
|
261
|
-
requirements:
|
262
|
-
- -
|
263
|
-
- !ruby/object:Gem::Version
|
264
|
-
|
265
|
-
segments:
|
334
|
+
requirements:
|
335
|
+
- - ">="
|
336
|
+
- !ruby/object:Gem::Version
|
337
|
+
hash: 3
|
338
|
+
segments:
|
266
339
|
- 0
|
267
|
-
|
340
|
+
version: "0"
|
268
341
|
requirements: []
|
342
|
+
|
269
343
|
rubyforge_project:
|
270
|
-
rubygems_version: 1.8.
|
344
|
+
rubygems_version: 1.8.10
|
271
345
|
signing_key:
|
272
346
|
specification_version: 3
|
273
347
|
summary: Send your application errors to our hosted service and reclaim your inbox.
|
274
|
-
test_files:
|
348
|
+
test_files:
|
275
349
|
- features/metal.feature
|
276
350
|
- features/rack.feature
|
277
351
|
- features/rails.feature
|