airbrake-ruby 2.6.2 → 2.7.0

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: bfb305315b4b308b5b150ef07619a83e4415293b
4
- data.tar.gz: 5cbe55d62543c114a2b30a89bf2a6af976b829e6
3
+ metadata.gz: 392ec545e8faf2ca880b1532e3ed2f58c61f137f
4
+ data.tar.gz: 21d30392222f48f506d01e7f8c1493e2cb59db6a
5
5
  SHA512:
6
- metadata.gz: 1a0b115c51be62a588c47e14b427ca813be479628ad73112cb5a819710e699b3c24bf83eeadb1cccdd0ea019f396fafbbd27fd2799a946d94023350a447e71a2
7
- data.tar.gz: 0b38291654d4c8b2d6e26e22a981917bb12f63b249d70970b6dcf329a99a67b9528f36db31231395f877dff860f743893bcb39bdd6b0740617dcf4d4b031c507
6
+ metadata.gz: f85246932ea192e9244d8b873efefa7dd67a14380bacaa60001db0737ac424c71d8993cb00169a1dad23ba7106f7349d78ab33f257cc0c0c9181e4aaf11f1927
7
+ data.tar.gz: f5dfba3084a423a960d554f95573a6611b52a8b88201ac8e7f7a62e0639587b1bf37da2fc3f3d930589b437a64edff40277da9c11f94d09c8865ae1e59483d64
@@ -41,9 +41,7 @@ module Airbrake
41
41
  # @raise [Airbrake::Error] when invoked more than one time
42
42
  def close
43
43
  threads = @mutex.synchronize do
44
- if closed?
45
- raise Airbrake::Error, 'attempted to close already closed sender'
46
- end
44
+ raise Airbrake::Error, 'attempted to close already closed sender' if closed?
47
45
 
48
46
  unless @unsent.empty?
49
47
  msg = "#{LOG_LABEL} waiting to send #{@unsent.size} unsent notice(s)..."
@@ -197,9 +197,7 @@ module Airbrake
197
197
  next(frame) if config.code_hunks.nil? || frame[:file].nil?
198
198
 
199
199
  if !root_directory.empty?
200
- if frame[:file].start_with?(root_directory)
201
- populate_code(config, frame)
202
- end
200
+ populate_code(config, frame) if frame[:file].start_with?(root_directory)
203
201
  elsif i < CODE_FRAME_LIMIT
204
202
  populate_code(config, frame)
205
203
  end
@@ -18,7 +18,7 @@ module Airbrake
18
18
  # @return [String]
19
19
  WRONG_ENV_TYPE_MSG = "the 'environment' option must be configured " \
20
20
  "with a Symbol (or String), but '%s' was provided: " \
21
- "%s".freeze
21
+ '%s'.freeze
22
22
 
23
23
  ##
24
24
  # @return [Array<Class>] the list of allowed types to configure the
@@ -11,8 +11,10 @@ module Airbrake
11
11
  # @return [Array<Class>] filters to be executed first
12
12
  DEFAULT_FILTERS = [
13
13
  Airbrake::Filters::SystemExitFilter,
14
- Airbrake::Filters::GemRootFilter,
15
- Airbrake::Filters::ThreadFilter
14
+ Airbrake::Filters::GemRootFilter
15
+
16
+ # Optional filters (must be included by users):
17
+ # Airbrake::Filters::ThreadFilter
16
18
  ].freeze
17
19
 
18
20
  ##
@@ -29,9 +29,7 @@ module Airbrake
29
29
  def initialize(user_config)
30
30
  @config = (user_config.is_a?(Config) ? user_config : Config.new(user_config))
31
31
 
32
- unless @config.valid?
33
- raise Airbrake::Error, @config.validation_error_message
34
- end
32
+ raise Airbrake::Error, @config.validation_error_message unless @config.valid?
35
33
 
36
34
  @filter_chain = FilterChain.new
37
35
  add_default_filters
@@ -126,9 +124,7 @@ module Airbrake
126
124
  @filter_chain.refine(notice)
127
125
  yield notice if block_given? && !notice.ignored?
128
126
 
129
- if notice.ignored?
130
- return promise.reject("#{notice} was marked as ignored")
131
- end
127
+ return promise.reject("#{notice} was marked as ignored") if notice.ignored?
132
128
 
133
129
  sender.send(notice, promise)
134
130
  end
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.6.2'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.7.0'.freeze
8
8
  end
@@ -163,11 +163,11 @@ RSpec.describe Airbrake do
163
163
  filter_chain = notifier.instance_variable_get(:@filter_chain)
164
164
  filters = filter_chain.instance_variable_get(:@filters)
165
165
 
166
- expect(filters.size).to eq(4)
166
+ expect(filters.size).to eq(3)
167
167
 
168
- described_class.add_filter {}
168
+ described_class.add_filter{}
169
169
 
170
- expect(filters.size).to eq(5)
170
+ expect(filters.size).to eq(4)
171
171
  expect(filters.last).to be_a(Proc)
172
172
  end
173
173
  end
data/spec/notice_spec.rb CHANGED
@@ -156,7 +156,7 @@ RSpec.describe Airbrake::Notice do
156
156
  end
157
157
 
158
158
  describe "object replacement with its string version" do
159
- let(:klass) { Class.new {} }
159
+ let(:klass) { Class.new{} }
160
160
  let(:ex) { AirbrakeTestError.new }
161
161
  let(:params) { { bingo: [Object.new, klass.new] } }
162
162
  let(:notice) { described_class.new(Airbrake::Config.new, ex, params) }
@@ -152,10 +152,6 @@ RSpec.describe Airbrake::Notifier do
152
152
  /"params":{"bingo":\["bango"\],"bongo":"bish".*}/
153
153
  )
154
154
  end
155
-
156
- it "features 'params/thread'" do
157
- expect_a_request_with_body(/"params":{.*"thread":{.*}/)
158
- end
159
155
  end
160
156
  end
161
157
 
@@ -464,9 +460,7 @@ RSpec.describe Airbrake::Notifier do
464
460
  describe "#add_filter" do
465
461
  it "filters notices" do
466
462
  @airbrake.add_filter do |notice|
467
- if notice[:params][:password]
468
- notice[:params][:password] = '[Filtered]'.freeze
469
- end
463
+ notice[:params][:password] = '[Filtered]'.freeze if notice[:params][:password]
470
464
  end
471
465
 
472
466
  @airbrake.notify_sync(ex, password: 's4kr4t')
data/spec/promise_spec.rb CHANGED
@@ -7,7 +7,7 @@ RSpec.describe Airbrake::Promise do
7
7
 
8
8
  context "when it is not resolved" do
9
9
  it "returns self" do
10
- expect(subject.then {}).to eq(subject)
10
+ expect(subject.then{}).to eq(subject)
11
11
  end
12
12
 
13
13
  it "doesn't call the resolve callbacks yet" do
@@ -19,7 +19,7 @@ RSpec.describe Airbrake::Promise do
19
19
  context "when it is resolved" do
20
20
  shared_examples "then specs" do
21
21
  it "returns self" do
22
- expect(subject.then {}).to eq(subject)
22
+ expect(subject.then{}).to eq(subject)
23
23
  end
24
24
 
25
25
  it "yields the resolved value" do
@@ -74,7 +74,7 @@ RSpec.describe Airbrake::Promise do
74
74
 
75
75
  context "when it is not rejected" do
76
76
  it "returns self" do
77
- expect(subject.then {}).to eq(subject)
77
+ expect(subject.then{}).to eq(subject)
78
78
  end
79
79
 
80
80
  it "doesn't call the reject callbacks yet" do
@@ -86,7 +86,7 @@ RSpec.describe Airbrake::Promise do
86
86
  context "when it is rejected" do
87
87
  shared_examples "rescue specs" do
88
88
  it "returns self" do
89
- expect(subject.rescue {}).to eq(subject)
89
+ expect(subject.rescue{}).to eq(subject)
90
90
  end
91
91
 
92
92
  it "yields the rejected value" 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.6.2
4
+ version: 2.7.0
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-12-04 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec