airbrake 5.0.1 → 5.0.2

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: f61198ae3f44ed8012912bcacecd4d3968c762e2
4
- data.tar.gz: c64fd32fc1e5b63b1c25ce8d29f8cb107fa1298b
3
+ metadata.gz: 6ab3ca0f2da53158314a06cff1221b306b8f6d5c
4
+ data.tar.gz: 5708b6bddf8050ef43cd9152fca9220e5144024f
5
5
  SHA512:
6
- metadata.gz: db018ad722ee742160659d09cc128f91e484b26d48d1c319b1e485b25869354a3410d3185274553a0a4b3f58dde9354769e2c1a98802a9e5eff91c4859eb17db
7
- data.tar.gz: f85054a16ab69165d424c2e1dfa1dc46faac80667f3db66304c85716335fbcfe266da2fe9f5a3267a239f7398b49b88b7287f5e14aec0b350680a9e83cd1ce6f
6
+ metadata.gz: 06b242299e02ae341fc6bf2fe622137dcb8dacac181cc5a23c401b15a2eff3541822c03fe5aa19d5bdf0529463025f0da819f8367a5476009c2307a75003012c
7
+ data.tar.gz: dfd32fb172a73531fa96c63f150dedb2bc643b49b10820545a14d56d67648414586abe02ce386a01598faefa4f0fed4b78266c6b479b9e90f7fb925f567a5f43
@@ -11,7 +11,8 @@ module Airbrake
11
11
  # @return [Airbrake::Rack::User, nil]
12
12
  def self.extract(rack_env)
13
13
  return unless (warden = rack_env['warden'])
14
- new(warden.user(run_callbacks: false))
14
+ return unless (warden_user = warden.user(run_callbacks: false))
15
+ new(warden_user)
15
16
  end
16
17
 
17
18
  ##
@@ -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.0.1'.freeze
5
+ AIRBRAKE_VERSION = '5.0.2'.freeze
6
6
  end
@@ -36,6 +36,16 @@ RSpec.describe Airbrake::Rack::User do
36
36
  retval = described_class.extract(env_for('/', 'warden' => warden))
37
37
  expect(retval).to be_a(described_class)
38
38
  end
39
+
40
+ context "and the warden user is nil" do
41
+ it "returns nil" do
42
+ warden = instance_double('Warden::Proxy')
43
+ allow(warden).to receive(:user) { nil }
44
+
45
+ retval = described_class.extract(env_for('/', 'warden' => warden))
46
+ expect(retval).to be_nil
47
+ end
48
+ end
39
49
  end
40
50
 
41
51
  context "when the Warden authentication framework is absent" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
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-21 00:00:00.000000000 Z
11
+ date: 2016-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: airbrake-ruby
@@ -251,3 +251,4 @@ test_files:
251
251
  - spec/unit/rack/notice_builder_spec.rb
252
252
  - spec/unit/sidekiq/error_handler_spec.rb
253
253
  - spec/unit/rake/tasks_spec.rb
254
+ has_rdoc: