resque-rollbar 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/failure/rollbar.rb +17 -1
- data/lib/resque/rollbar/version.rb +1 -1
- data/spec/resque/failure/rollbar_spec.rb +21 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d42e55fb54188844e7c6278bcd7728f1dbb30ab5
|
4
|
+
data.tar.gz: cd09e85b423ea665987019f71b2cbb7b490681f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad1c6b0b53114fbc7f1da98fd46f5302eb41f2dad4869feb518b8181d93e9cd61862fd66498670eeb772c4119992fd636410595a493e5a9d011c06e5a815435d
|
7
|
+
data.tar.gz: 600b9f04a759d0ff42bba7f746eba7be62d874eb67587cdcdd52becb4d54d3687ec586d3ab0aca2e5a3c6b22be4327e8c2619e2bf19cdf56bea922ecb4309608
|
@@ -5,7 +5,23 @@ module Resque
|
|
5
5
|
module Failure
|
6
6
|
class Rollbar < Base
|
7
7
|
def save
|
8
|
-
::Rollbar.error(exception,
|
8
|
+
::Rollbar.error(exception, rollbar_payload)
|
9
|
+
end
|
10
|
+
|
11
|
+
def rollbar_payload
|
12
|
+
if use_exception_level_filters?
|
13
|
+
payload.merge(:use_exception_level_filters => true)
|
14
|
+
else
|
15
|
+
payload
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def use_exception_level_filters?
|
20
|
+
rollbar_version.split('.')[1].to_i > 3
|
21
|
+
end
|
22
|
+
|
23
|
+
def rollbar_version
|
24
|
+
::Rollbar::VERSION
|
9
25
|
end
|
10
26
|
end
|
11
27
|
end
|
@@ -1,14 +1,29 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Resque::Failure::Rollbar do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
let(:exception) { StandardError.new('BOOM') }
|
5
|
+
let(:worker) { Resque::Worker.new(:test) }
|
6
|
+
let(:queue) { 'test' }
|
7
|
+
let(:payload) { { 'class' => Object, 'args' => 89 } }
|
8
|
+
let(:backend) do
|
9
|
+
Resque::Failure::Rollbar.new(exception, worker, queue, payload)
|
10
|
+
end
|
9
11
|
|
12
|
+
it 'should be notified of an error' do
|
10
13
|
expect(Rollbar.notifier).to receive(:log).with('error', exception, payload)
|
11
|
-
backend = Resque::Failure::Rollbar.new(exception, worker, queue, payload)
|
12
14
|
backend.save
|
13
15
|
end
|
16
|
+
|
17
|
+
context 'with Rollbar version > 1.3' do
|
18
|
+
let(:rollbar_payload) { payload.merge(:use_exception_level_filters => true) }
|
19
|
+
|
20
|
+
before do
|
21
|
+
allow(backend).to receive(:rollbar_version).and_return('1.4.0')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'sends the :use_exception_level_filters option' do
|
25
|
+
expect(Rollbar.notifier).to receive(:error).with(exception, rollbar_payload)
|
26
|
+
backend.save
|
27
|
+
end
|
28
|
+
end
|
14
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|