airbrake-ruby 2.7.0 → 2.7.1

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: 392ec545e8faf2ca880b1532e3ed2f58c61f137f
4
- data.tar.gz: 21d30392222f48f506d01e7f8c1493e2cb59db6a
3
+ metadata.gz: 72df910469517a95b5188333116cacfd8e131210
4
+ data.tar.gz: b31e5d88736c6d810104ac4f4ca62f4771473ebc
5
5
  SHA512:
6
- metadata.gz: f85246932ea192e9244d8b873efefa7dd67a14380bacaa60001db0737ac424c71d8993cb00169a1dad23ba7106f7349d78ab33f257cc0c0c9181e4aaf11f1927
7
- data.tar.gz: f5dfba3084a423a960d554f95573a6611b52a8b88201ac8e7f7a62e0639587b1bf37da2fc3f3d930589b437a64edff40277da9c11f94d09c8865ae1e59483d64
6
+ metadata.gz: 24393ff4bd5881d41ecfed282110a43f0b394539990f95fbd8d0663e1bf8658aa6871bfd5fac38bb46e9580002b0af96c9ca13185f4737887837c50398ef4643
7
+ data.tar.gz: 6a305e5efdd77cc5adebf73b55dac88ea33a6914e0871bd35c53b4d62888db85670aa3302674b8f36f38c21d39923eb33903f85b93e9415101e0f190bc31ed1a
@@ -194,7 +194,7 @@ module Airbrake
194
194
 
195
195
  exception.backtrace.map.with_index do |stackframe, i|
196
196
  frame = stack_frame(config, regexp, stackframe)
197
- next(frame) if config.code_hunks.nil? || frame[:file].nil?
197
+ next(frame) if !config.code_hunks || frame[:file].nil?
198
198
 
199
199
  if !root_directory.empty?
200
200
  populate_code(config, frame) if frame[:file].start_with?(root_directory)
@@ -4,5 +4,5 @@
4
4
  module Airbrake
5
5
  ##
6
6
  # @return [String] the library version
7
- AIRBRAKE_RUBY_VERSION = '2.7.0'.freeze
7
+ AIRBRAKE_RUBY_VERSION = '2.7.1'.freeze
8
8
  end
@@ -165,7 +165,7 @@ RSpec.describe Airbrake do
165
165
 
166
166
  expect(filters.size).to eq(3)
167
167
 
168
- described_class.add_filter{}
168
+ described_class.add_filter {}
169
169
 
170
170
  expect(filters.size).to eq(4)
171
171
  expect(filters.last).to be_a(Proc)
@@ -420,5 +420,35 @@ RSpec.describe Airbrake::Backtrace do
420
420
  end
421
421
  end
422
422
  end
423
+
424
+ context "when code hunks are disabled" do
425
+ let(:config) do
426
+ config = Airbrake::Config.new
427
+ config.logger = Logger.new('/dev/null')
428
+ config.code_hunks = false
429
+ config
430
+ end
431
+
432
+ context "and when root_directory is configured" do
433
+ before { config.root_directory = project_root_path('') }
434
+
435
+ let(:parsed_backtrace) do
436
+ [
437
+ {
438
+ file: project_root_path('code.rb'),
439
+ line: 94,
440
+ function: 'to_json'
441
+ }
442
+ ]
443
+ end
444
+
445
+ it "doesn't attach code to frames" do
446
+ ex = RuntimeError.new
447
+ backtrace = [project_root_path('code.rb') + ":94:in `to_json'"]
448
+ ex.set_backtrace(backtrace)
449
+ expect(described_class.parse(config, ex)).to eq(parsed_backtrace)
450
+ end
451
+ end
452
+ end
423
453
  end
424
454
  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) }
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.7.0
4
+ version: 2.7.1
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-13 00:00:00.000000000 Z
11
+ date: 2018-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec