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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e0b8a983d9bbd1f4b07e94bbc77e7ecc7da3149
4
- data.tar.gz: 28e61e26cf914c6d688601fcd775291deddd5c9f
3
+ metadata.gz: 5a03c0feac5ee581e853b64a86f88ea4e4d292bb
4
+ data.tar.gz: 21d2997c402ba1de6a415cfd572b732d66248f5e
5
5
  SHA512:
6
- metadata.gz: 24386e09635bee179b11bb836e6440034947675d1ea509029105a28d1d8c507a5185f10949d11b58123c119530a8c7e5a4f55ebc8054a1475e2754eb4053fa8f
7
- data.tar.gz: ffa255cceab9397485b1ca313259179768129909ae0b50ee5b9dee831fabed3ea3b954c438c9d64d315219302be0878b8192497894e29f5be08588e300bf28f3
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"
@@ -3,5 +3,5 @@
3
3
  module Airbrake
4
4
  ##
5
5
  # @return [String] the library version
6
- AIRBRAKE_RUBY_VERSION = '1.0.0'.freeze
6
+ AIRBRAKE_RUBY_VERSION = '1.0.1'.freeze
7
7
  end
@@ -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
- before do
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
@@ -120,7 +120,7 @@ RSpec.describe Airbrake::Notifier do
120
120
  end
121
121
 
122
122
  it "features 'context'" do
123
- expect_a_request_with_body(/"context":{.*"os":"[\w-]+"/)
123
+ expect_a_request_with_body(/"context":{.*"os":"[\.\w-]+"/)
124
124
  end
125
125
 
126
126
  it "features 'errors'" do
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.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-18 00:00:00.000000000 Z
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: