airbrake-ruby 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby/filters/thread_filter.rb +11 -1
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/filters/thread_filter_spec.rb +30 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d64cdba9f23541f20ba15bc0d7e4428cdec2f18b
|
4
|
+
data.tar.gz: 6adece1384ee220679a705b3343850bd2401473e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
@@ -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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
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]
|
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.
|
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-
|
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.
|
171
|
+
rubygems_version: 2.6.8
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Ruby notifier for https://airbrake.io
|