airbrake-ruby 2.2.1 → 2.2.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: 21223403ddfa03e2f851d2cb5c4a74130e17840f
4
- data.tar.gz: ab65e845c6053434813b8bbf0f23edaa80dad44d
3
+ metadata.gz: d64cdba9f23541f20ba15bc0d7e4428cdec2f18b
4
+ data.tar.gz: 6adece1384ee220679a705b3343850bd2401473e
5
5
  SHA512:
6
- metadata.gz: e045ca4229249ab1cfc9be1b5d94e72bc633134f4e6fbf34a8a3f16068a042823aa5e5fd09d085220de83313ab22c48bb1ab773549b776dbb64fc6a721356bf1
7
- data.tar.gz: 24117e363c96f7cc6673c63cae41ab5306de8ed61bd03c08d6e011fb52cc17d2bf13d8394a797428ef0428ca151e3188995dff733cdb71d8693a22be1de112ce
6
+ metadata.gz: 91de811f9e41f506ac429361f692c795f1622452b63b500770ad3910178c5fdf0e0685c37c9a035c014a653a212fadb1bdf692011bd37d17b17a6ba0ec541790
7
+ data.tar.gz: 93f7598aca53fc4d2d672b357bc43727ebb937624a97e55835c1dfe35134f120e9812a734e0c33f3add558ada30201c0ce0fbada1247da2c1f425be82155ec06
@@ -8,6 +8,16 @@ module Airbrake
8
8
  # @return [Integer]
9
9
  attr_reader :weight
10
10
 
11
+ ##
12
+ # @return [Array<Symbol>] the list of ignored fiber variables
13
+ IGNORED_FIBER_VARIABLES = [
14
+ # https://github.com/airbrake/airbrake-ruby/issues/204
15
+ :__recursive_key__,
16
+
17
+ # https://github.com/rails/rails/issues/28996
18
+ :__rspec
19
+ ].freeze
20
+
11
21
  def initialize
12
22
  @weight = 110
13
23
  end
@@ -45,7 +55,7 @@ module Airbrake
45
55
 
46
56
  def fiber_variables(th)
47
57
  th.keys.map.with_object({}) do |key, h|
48
- next if key == :__recursive_key__
58
+ next if IGNORED_FIBER_VARIABLES.any? { |v| v == key }
49
59
  next if (value = th[key]).is_a?(IO)
50
60
  h[key] = value
51
61
  end
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.2.1'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.2.2'.freeze
8
8
  end
@@ -6,10 +6,31 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
6
6
  let(:notice) { Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new) }
7
7
  let(:th) { Thread.current }
8
8
 
9
+ shared_examples "fiber variable ignore" do |key|
10
+ it "ignores the :#{key} fiber variable" do
11
+ th[key] = :bingo
12
+ subject.call(notice)
13
+ th[key] = nil
14
+
15
+ fiber_variables = notice[:params][:thread][:fiber_variables]
16
+ if RUBY_ENGINE == 'jruby'
17
+ expect(fiber_variables).to be_nil
18
+ else
19
+ expect(fiber_variables[key]).to be_nil
20
+ end
21
+ end
22
+ end
23
+
24
+ %i[__recursive_key__ __rspec].each do |key|
25
+ include_examples "fiber variable ignore", key
26
+ end
27
+
9
28
  it "appends thread variables" do
10
- th.thread_variable_set(:bingo, :bango)
11
- subject.call(notice)
12
- th.thread_variable_set(:bingo, nil)
29
+ Thread.new do
30
+ th.thread_variable_set(:bingo, :bango)
31
+ subject.call(notice)
32
+ th.thread_variable_set(:bingo, nil)
33
+ end.join
13
34
 
14
35
  expect(notice[:params][:thread][:thread_variables][:bingo]).to eq(:bango)
15
36
  end
@@ -62,11 +83,13 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
62
83
  end
63
84
 
64
85
  it "doesn't append the IO object to thread variables" do
65
- th.thread_variable_set(:io, io_obj)
66
- subject.call(notice)
67
- th.thread_variable_set(:io, nil)
86
+ Thread.new do
87
+ th.thread_variable_set(:io, io_obj)
88
+ subject.call(notice)
89
+ th.thread_variable_set(:io, nil)
90
+ end.join
68
91
 
69
- expect(notice[:params][:thread][:thread_variables][:io]).to be_nil
92
+ expect(notice[:params][:thread][:thread_variables]).to be_nil
70
93
  end
71
94
 
72
95
  it "doesn't append the IO object to thread variables" 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: 2.2.1
4
+ version: 2.2.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: 2017-05-04 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.2.5
171
+ rubygems_version: 2.6.8
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Ruby notifier for https://airbrake.io