airbrake-ruby 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby.rb +2 -2
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/airbrake_spec.rb +15 -1
- data/spec/notifier_spec.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a03c0feac5ee581e853b64a86f88ea4e4d292bb
|
4
|
+
data.tar.gz: 21d2997c402ba1de6a415cfd572b732d66248f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf739314018cc942015abc6acf329c9183dd3a5fadab558cfbd5acb1f9f02f6d104fd93b96f3f78b2f240ac2fb01fcb219b50fc6176b779bdeae8018725125b1
|
7
|
+
data.tar.gz: 65d98d04c54cb7c4e06f7630394d532dc3f1f9baa4899b81ce1989e83c305824610fc7550a589f9ba792ebda52dbf158a2eb92ded6b435906723e9ff752af66c
|
data/lib/airbrake-ruby.rb
CHANGED
@@ -275,9 +275,9 @@ module Airbrake
|
|
275
275
|
# Calls +method+ on +notifier+ with provided +args+.
|
276
276
|
#
|
277
277
|
# @raise [Airbrake::Error] if none of the notifiers exist
|
278
|
-
def call_notifier(notifier, method, *args)
|
278
|
+
def call_notifier(notifier, method, *args, &block)
|
279
279
|
if @notifiers.key?(notifier)
|
280
|
-
@notifiers[notifier].__send__(method, *args)
|
280
|
+
@notifiers[notifier].__send__(method, *args, &block)
|
281
281
|
else
|
282
282
|
raise Airbrake::Error,
|
283
283
|
"the '#{notifier}' notifier isn't configured"
|
data/spec/airbrake_spec.rb
CHANGED
@@ -5,12 +5,14 @@ RSpec.describe Airbrake do
|
|
5
5
|
'https://airbrake.io/api/v3/projects/113743/notices?key=fd04e13d806a90f96614ad8e529b2822'
|
6
6
|
end
|
7
7
|
|
8
|
-
|
8
|
+
let!(:notifier) do
|
9
9
|
described_class.configure do |c|
|
10
10
|
c.project_id = 113743
|
11
11
|
c.project_key = 'fd04e13d806a90f96614ad8e529b2822'
|
12
12
|
end
|
13
|
+
end
|
13
14
|
|
15
|
+
before do
|
14
16
|
stub_request(:post, endpoint).to_return(status: 201, body: '{}')
|
15
17
|
end
|
16
18
|
|
@@ -161,6 +163,18 @@ RSpec.describe Airbrake do
|
|
161
163
|
|
162
164
|
describe ".add_filter" do
|
163
165
|
include_examples 'error handling', :add_filter
|
166
|
+
|
167
|
+
it "adds filters with help of blocks" do
|
168
|
+
filter_chain = notifier.instance_variable_get(:@filter_chain)
|
169
|
+
filters = filter_chain.instance_variable_get(:@filters)
|
170
|
+
|
171
|
+
expect(filters.size).to eq(2)
|
172
|
+
|
173
|
+
described_class.add_filter {}
|
174
|
+
|
175
|
+
expect(filters.size).to eq(3)
|
176
|
+
expect(filters.last).to be_a(Proc)
|
177
|
+
end
|
164
178
|
end
|
165
179
|
|
166
180
|
describe ".whitelist_keys" do
|
data/spec/notifier_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -155,4 +155,3 @@ test_files:
|
|
155
155
|
- spec/notice_spec.rb
|
156
156
|
- spec/config_spec.rb
|
157
157
|
- spec/filter_chain_spec.rb
|
158
|
-
has_rdoc:
|