airbrake 5.8.0 → 5.8.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: 4eca387c60925461641f766aaefcda3b89275170
4
- data.tar.gz: 1a7e717aa724abc16752e03b529513ba0998a96a
3
+ metadata.gz: ad6d5f1f3dbd4190b70472b3109bd24c70b25884
4
+ data.tar.gz: b3af8d47bf1f2f79f0d624ea8726c482bc31ea71
5
5
  SHA512:
6
- metadata.gz: 2a58e5561cdf1754f291cee350f6b843fb24bfc45a29690b36491e3794dd20b729e4f27bc37ad7e059b2f8ed0bf183bc0b3a7a07c3061b0e7500337e5a600976
7
- data.tar.gz: d932b7e5c694f9eac25919af9c246862a415f194da64f727cd24ca53e8dde236036dc5e469d86a8f40c06cfb8bfc27959a3331859176ed99cb5a0e2e0eee0f59
6
+ metadata.gz: 60754321fb09cb14b563d65d77a42a6df481c3530107a6cb127d83782fe01b883dd0cbbfa832f004672c8c04ecabe6dfe9449ee3d0e2fb7e7d3881d04607fc3b
7
+ data.tar.gz: 4b6433d157646f90229817032c50a252f7fef3ea3b9e6a28b931debe4eebb070dee0537c77e93a2828e0b9dd1afa9a1da3ee1acedbdc898dac9a758c078b7d6a
@@ -30,14 +30,15 @@ module Airbrake
30
30
 
31
31
  def initialize(app, notifier_name = :default)
32
32
  @app = app
33
- @notifier_name = notifier_name
33
+ @notifier = Airbrake[notifier_name]
34
34
 
35
35
  # Prevent adding same filters to the same notifier.
36
36
  return if @@known_notifiers.include?(notifier_name)
37
37
  @@known_notifiers << notifier_name
38
38
 
39
+ return unless @notifier
39
40
  RACK_FILTERS.each do |filter|
40
- Airbrake[notifier_name].add_filter(filter.new)
41
+ @notifier.add_filter(filter.new)
41
42
  end
42
43
  end
43
44
 
@@ -64,11 +65,11 @@ module Airbrake
64
65
  private
65
66
 
66
67
  def notify_airbrake(exception, env)
67
- notice = Airbrake[@notifier_name].build_notice(exception)
68
+ notice = @notifier.build_notice(exception)
68
69
  return unless notice
69
70
 
70
71
  notice.stash[:rack_request] = ::Rack::Request.new(env)
71
- Airbrake[@notifier_name].notify(notice)
72
+ @notifier.notify(notice)
72
73
  end
73
74
 
74
75
  ##
@@ -2,5 +2,5 @@
2
2
  # We use Semantic Versioning v2.0.0
3
3
  # More information: http://semver.org/
4
4
  module Airbrake
5
- AIRBRAKE_VERSION = '5.8.0'.freeze
5
+ AIRBRAKE_VERSION = '5.8.1'.freeze
6
6
  end
@@ -27,6 +27,14 @@ RSpec.describe Airbrake::Rack::Middleware do
27
27
  stub_request(:post, endpoint).to_return(status: 201, body: '{}')
28
28
  end
29
29
 
30
+ describe "#new" do
31
+ it "doesn't add filters if no notifiers are configured" do
32
+ expect do
33
+ expect(described_class.new(faulty_app, :unknown_notifier))
34
+ end.not_to raise_error
35
+ end
36
+ end
37
+
30
38
  describe "#call" do
31
39
  context "when app raises an exception" do
32
40
  context "and when the notifier name is specified" do
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: 5.8.0
4
+ version: 5.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake Technologies, Inc.