rollbar 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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +10 -8
- data/lib/generators/rollbar/templates/initializer.rb +7 -0
- data/lib/rollbar.rb +1 -1
- data/lib/rollbar/util.rb +5 -2
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar/util_spec.rb +19 -0
- data/spec/rollbar_spec.rb +9 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 307192963be4a3aefcd14f135c284089329768e8
|
4
|
+
data.tar.gz: 827eab30ef25e8da4c2ad4befcd48f6e9d142794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa47e8350d65964e7077556ec9c5930ae429850ce83a8ca945dd57415429c8c800f7617d99b440e2596e01e7d0613b72f31b0d40f9a1341ffc75dec625ae9327
|
7
|
+
data.tar.gz: 313592eef5826b4f7bb9674848b28d30b2e366fd4ad580b5a1478fb18d118ff9f49a6ad5d54bb349adc80794460ae8ae239b2e856d4680f9cd17921625c47a06
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 2.7.1
|
4
|
+
|
5
|
+
- Suggest using ROLLBAR_ENV for staging apps. See [#353](https://github.com/rollbar/rollbar-gem/pull/353).
|
6
|
+
- Fix Rollbar::Util.deep_merge so it has default values for arguments. See [#362](https://github.com/rollbar/rollbar-gem/pull/362).
|
7
|
+
- Ignore exception cause when it's not another exception. See [#357](https://github.com/rollbar/rollbar-gem/pull/357).
|
8
|
+
|
9
|
+
|
3
10
|
## 2.7.0
|
4
11
|
|
5
12
|
- Delayed job integration fix. See [#355](https://github.com/rollbar/rollbar-gem/pull/355).
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.7.
|
1
|
+
# Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.7.1)](https://travis-ci.org/rollbar/rollbar-gem/branches)
|
2
2
|
|
3
3
|
<!-- RemoveNext -->
|
4
4
|
[Rollbar](https://rollbar.com) is an error tracking service for Ruby and other languages. The Rollbar service will alert you of problems with your code and help you understand them in a ways never possible before. We love it and we hope you will too.
|
@@ -12,13 +12,7 @@ This is the Ruby library for Rollbar. It will instrument many kinds of Ruby appl
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
14
|
```ruby
|
15
|
-
gem 'rollbar', '~> 2.7.
|
16
|
-
```
|
17
|
-
|
18
|
-
If you are not using JRuby we suggest using [Oj](https://github.com/ohler55/oj) for JSON serialization. In order to install Oj you can add this line to your Gemfile:
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
gem 'oj', '~> 2.12.14'
|
15
|
+
gem 'rollbar', '~> 2.7.1'
|
22
16
|
```
|
23
17
|
|
24
18
|
And then execute:
|
@@ -29,6 +23,14 @@ $ bundle install
|
|
29
23
|
$ gem install rollbar
|
30
24
|
```
|
31
25
|
|
26
|
+
Unless you are using JRuby, we suggest also installing [Oj](https://github.com/ohler55/oj) for JSON serialization. Add this line to your Gemfile:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
gem 'oj', '~> 2.12.14'
|
30
|
+
```
|
31
|
+
|
32
|
+
and then `bundle install` again.
|
33
|
+
|
32
34
|
### If using Rails
|
33
35
|
|
34
36
|
Run the following command from your Rails root:
|
@@ -56,4 +56,11 @@ Rollbar.configure do |config|
|
|
56
56
|
# config.use_sidekiq
|
57
57
|
# You can supply custom Sidekiq options:
|
58
58
|
# config.use_sidekiq 'queue' => 'default'
|
59
|
+
|
60
|
+
# If you run your staging application instance in production environment then
|
61
|
+
# you'll want to override the environment reported by `Rails.env` with an
|
62
|
+
# environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended
|
63
|
+
# setup for Heroku. See:
|
64
|
+
# https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
|
65
|
+
config.environment = ENV['ROLLBAR_ENV'] || Rails.env
|
59
66
|
end
|
data/lib/rollbar.rb
CHANGED
@@ -442,7 +442,7 @@ module Rollbar
|
|
442
442
|
traces = [trace_data(exception)]
|
443
443
|
visited = [exception]
|
444
444
|
|
445
|
-
while exception.respond_to?(:cause) && (cause = exception.cause) && !visited.include?(cause)
|
445
|
+
while exception.respond_to?(:cause) && (cause = exception.cause) && cause.is_a?(Exception) && !visited.include?(cause)
|
446
446
|
traces << trace_data(cause)
|
447
447
|
visited << cause
|
448
448
|
exception = cause
|
data/lib/rollbar/util.rb
CHANGED
@@ -66,10 +66,13 @@ module Rollbar
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def self.deep_merge(hash1, hash2)
|
69
|
+
hash1 ||= {}
|
70
|
+
hash2 ||= {}
|
71
|
+
|
69
72
|
hash2.each_key do |k|
|
70
|
-
if hash1[k].is_a?
|
73
|
+
if hash1[k].is_a?(::Hash) && hash2[k].is_a?(::Hash)
|
71
74
|
hash1[k] = deep_merge(hash1[k], hash2[k])
|
72
|
-
elsif hash1[k].is_a?
|
75
|
+
elsif hash1[k].is_a?(Array) && hash2[k].is_a?(Array)
|
73
76
|
hash1[k] += deep_copy(hash2[k])
|
74
77
|
elsif hash2[k]
|
75
78
|
hash1[k] = deep_copy(hash2[k])
|
data/lib/rollbar/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'rollbar/util'
|
4
|
+
|
5
|
+
describe Rollbar::Util do
|
6
|
+
describe '.deep_merge' do
|
7
|
+
context 'with nil arguments' do
|
8
|
+
let(:data) do
|
9
|
+
{ :foo => :bar }
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'doesnt fail and returns same hash' do
|
13
|
+
result = Rollbar::Util.deep_merge(nil, data)
|
14
|
+
|
15
|
+
expect(result).to be_eql(data)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/rollbar_spec.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'logger'
|
4
4
|
require 'socket'
|
5
|
-
require 'spec_helper'
|
6
5
|
require 'girl_friday'
|
7
6
|
require 'redis'
|
8
7
|
require 'active_support/core_ext/object'
|
@@ -14,6 +13,8 @@ begin
|
|
14
13
|
rescue LoadError
|
15
14
|
end
|
16
15
|
|
16
|
+
require 'spec_helper'
|
17
|
+
|
17
18
|
describe Rollbar do
|
18
19
|
let(:notifier) { Rollbar.notifier }
|
19
20
|
before do
|
@@ -646,6 +647,13 @@ describe Rollbar do
|
|
646
647
|
chain[1][:exception][:message].should match(/the cause/)
|
647
648
|
end
|
648
649
|
|
650
|
+
it 'ignores the cause when it is not an Exception' do
|
651
|
+
exception_with_custom_cause = Exception.new('custom cause')
|
652
|
+
allow(exception_with_custom_cause).to receive(:cause) { "Foo" }
|
653
|
+
body = notifier.send(:build_payload_body_exception, message, exception_with_custom_cause, extra)
|
654
|
+
body[:trace].should_not be_nil
|
655
|
+
end
|
656
|
+
|
649
657
|
context 'with cyclic nested exceptions' do
|
650
658
|
let(:exception1) { Exception.new('exception1') }
|
651
659
|
let(:exception2) { Exception.new('exception2') }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -371,6 +371,7 @@ files:
|
|
371
371
|
- spec/rollbar/truncation/strings_strategy_spec.rb
|
372
372
|
- spec/rollbar/truncation_spec.rb
|
373
373
|
- spec/rollbar/util/hash_spec.rb
|
374
|
+
- spec/rollbar/util_spec.rb
|
374
375
|
- spec/rollbar_bc_spec.rb
|
375
376
|
- spec/rollbar_spec.rb
|
376
377
|
- spec/spec_helper.rb
|
@@ -491,6 +492,7 @@ test_files:
|
|
491
492
|
- spec/rollbar/truncation/strings_strategy_spec.rb
|
492
493
|
- spec/rollbar/truncation_spec.rb
|
493
494
|
- spec/rollbar/util/hash_spec.rb
|
495
|
+
- spec/rollbar/util_spec.rb
|
494
496
|
- spec/rollbar_bc_spec.rb
|
495
497
|
- spec/rollbar_spec.rb
|
496
498
|
- spec/spec_helper.rb
|