airbrake-ruby 2.2.2 → 2.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d64cdba9f23541f20ba15bc0d7e4428cdec2f18b
4
- data.tar.gz: 6adece1384ee220679a705b3343850bd2401473e
3
+ metadata.gz: 03b38987d8ca77dcd6c8302246192bd1a9184854
4
+ data.tar.gz: 93f4e52998430af6c6bcce0bca5e1b6dae3202ae
5
5
  SHA512:
6
- metadata.gz: 91de811f9e41f506ac429361f692c795f1622452b63b500770ad3910178c5fdf0e0685c37c9a035c014a653a212fadb1bdf692011bd37d17b17a6ba0ec541790
7
- data.tar.gz: 93f7598aca53fc4d2d672b357bc43727ebb937624a97e55835c1dfe35134f120e9812a734e0c33f3add558ada30201c0ce0fbada1247da2c1f425be82155ec06
6
+ metadata.gz: 9f2ae08f59cb532ca0313d7d16eebab0ea9e54c5796048c57fc6418d2c7b18d37744450651f4743d4147b7288aba6f25ae0d8db88d0135104a50d35444d59be1
7
+ data.tar.gz: 0a327f231fea3629de145c84570c17f48a5f0e9c37050ed0a3f53ab8cea9d59d83c17c03066c4e025051d6f0870b9b0e5591345e1d76f554a42744b0a55949b0
@@ -70,7 +70,7 @@ module Airbrake
70
70
 
71
71
  def filter_hash(hash)
72
72
  hash.each_key do |key|
73
- if should_filter?(key)
73
+ if should_filter?(key.to_s)
74
74
  hash[key] = FILTERED
75
75
  elsif hash[key].is_a?(Hash)
76
76
  filter_hash(hash[key])
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.2.2'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.2.3'.freeze
8
8
  end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Airbrake::Filters::KeysBlacklist do
4
+ subject do
5
+ described_class.new(Logger.new('/dev/null'), patterns)
6
+ end
7
+
8
+ describe "#call" do
9
+ let(:notice) do
10
+ Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new)
11
+ end
12
+
13
+ context "when a pattern is a regexp and when a key is a hash" do
14
+ let(:patterns) { [/bango/] }
15
+
16
+ it "doesn't fail" do
17
+ notice[:params] = { bingo: { {} => 'unfiltered' } }
18
+ expect { subject.call(notice) }.not_to raise_error
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,23 +1,30 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Airbrake::Filters::ThreadFilter do
4
- subject { described_class.new }
4
+ let(:notice) do
5
+ Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new)
6
+ end
7
+
8
+ def new_thread
9
+ Thread.new do
10
+ th = Thread.current
5
11
 
6
- let(:notice) { Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new) }
7
- let(:th) { Thread.current }
12
+ # Ensure a thread always has some variable to make sure the
13
+ # :fiber_variables Hash is always present.
14
+ th[:random_var] = 42
15
+ yield(th)
16
+ end.join
17
+ end
8
18
 
9
19
  shared_examples "fiber variable ignore" do |key|
10
20
  it "ignores the :#{key} fiber variable" do
11
- th[key] = :bingo
12
- subject.call(notice)
13
- th[key] = nil
21
+ new_thread do |th|
22
+ th[key] = :bingo
23
+ subject.call(notice)
24
+ end
14
25
 
15
26
  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
27
+ expect(fiber_variables[key]).to be_nil
21
28
  end
22
29
  end
23
30
 
@@ -26,27 +33,28 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
26
33
  end
27
34
 
28
35
  it "appends thread variables" do
29
- Thread.new do
36
+ new_thread do |th|
30
37
  th.thread_variable_set(:bingo, :bango)
31
38
  subject.call(notice)
32
- th.thread_variable_set(:bingo, nil)
33
- end.join
39
+ end
34
40
 
35
41
  expect(notice[:params][:thread][:thread_variables][:bingo]).to eq(:bango)
36
42
  end
37
43
 
38
44
  it "appends fiber variables" do
39
- th[:bingo] = :bango
40
- subject.call(notice)
41
- th[:bingo] = nil
45
+ new_thread do |th|
46
+ th[:bingo] = :bango
47
+ subject.call(notice)
48
+ end
42
49
 
43
50
  expect(notice[:params][:thread][:fiber_variables][:bingo]).to eq(:bango)
44
51
  end
45
52
 
46
53
  it "appends name", skip: !Thread.current.respond_to?(:name) do
47
- th.name = 'bingo'
48
- subject.call(notice)
49
- th.name = nil
54
+ new_thread do |th|
55
+ th.name = 'bingo'
56
+ subject.call(notice)
57
+ end
50
58
 
51
59
  expect(notice[:params][:thread][:name]).to eq('bingo')
52
60
  end
@@ -83,19 +91,19 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
83
91
  end
84
92
 
85
93
  it "doesn't append the IO object to thread variables" do
86
- Thread.new do
94
+ new_thread do |th|
87
95
  th.thread_variable_set(:io, io_obj)
88
96
  subject.call(notice)
89
- th.thread_variable_set(:io, nil)
90
- end.join
97
+ end
91
98
 
92
99
  expect(notice[:params][:thread][:thread_variables]).to be_nil
93
100
  end
94
101
 
95
102
  it "doesn't append the IO object to thread variables" do
96
- th[:io] = io_obj
97
- subject.call(notice)
98
- th[:io] = nil
103
+ new_thread do |th|
104
+ th[:io] = io_obj
105
+ subject.call(notice)
106
+ end
99
107
 
100
108
  expect(notice[:params][:thread][:fiber_variables][:io]).to be_nil
101
109
  end
data/spec/promise_spec.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Airbrake::Promise do
4
- subject { described_class.new }
5
-
6
4
  describe ".then" do
7
5
  let(:resolved_with) { [] }
8
6
  let(:rejected_with) { [] }
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.2
4
+ version: 2.2.3
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-05 00:00:00.000000000 Z
11
+ date: 2017-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -137,6 +137,7 @@ files:
137
137
  - spec/config/validator_spec.rb
138
138
  - spec/config_spec.rb
139
139
  - spec/filter_chain_spec.rb
140
+ - spec/filters/keys_blacklist_spec.rb
140
141
  - spec/filters/thread_filter_spec.rb
141
142
  - spec/nested_exception_spec.rb
142
143
  - spec/notice_spec.rb
@@ -179,6 +180,7 @@ test_files:
179
180
  - spec/config/validator_spec.rb
180
181
  - spec/config_spec.rb
181
182
  - spec/filter_chain_spec.rb
183
+ - spec/filters/keys_blacklist_spec.rb
182
184
  - spec/filters/thread_filter_spec.rb
183
185
  - spec/nested_exception_spec.rb
184
186
  - spec/notice_spec.rb