rollbar 0.12.5 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/THANKS.md +1 -0
- data/lib/rollbar.rb +8 -3
- data/lib/rollbar/configuration.rb +2 -0
- data/lib/rollbar/version.rb +1 -1
- data/spec/dummyapp/app/models/user.rb +0 -1
- data/spec/rollbar_spec.rb +42 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46603900db3bb897dbbdd72baa78f21e8c39ad43
|
4
|
+
data.tar.gz: ba03f938cc791c7db382f879e40ace48c582fd51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44e60e68802ca3cd885b8ae927c533d187dd213cac504843fe5edb4430778e26595306a24807f4263ca5798050424cbd7244346f201c61570fef67625d2919a9
|
7
|
+
data.tar.gz: 34d2198535bf88d45ed9df35e9c3442427ed5e63b5686c5cc27a764887f76f1918609c23fa8a04d3fa45759c47ed9dca166f3c82944ffb7e93cf7a32ec669319
|
data/CHANGELOG.md
CHANGED
data/THANKS.md
CHANGED
@@ -17,6 +17,7 @@ Huge thanks to the following contributors (by github username). For the most up-
|
|
17
17
|
- [juggler](https://github.com/juggler)
|
18
18
|
- [kavu](https://github.com/kavu)
|
19
19
|
- [magnolia-fan](https://github.com/magnolia-fan)
|
20
|
+
- [miloops](https://github.com/miloops)
|
20
21
|
- [mipearson](https://github.com/mipearson)
|
21
22
|
- [rogercampos](https://github.com/rogercampos)
|
22
23
|
- [siong1987](https://github.com/siong1987)
|
data/lib/rollbar.rb
CHANGED
@@ -20,7 +20,7 @@ require 'rollbar/railtie' if defined?(Rails)
|
|
20
20
|
module Rollbar
|
21
21
|
class << self
|
22
22
|
attr_writer :configuration
|
23
|
-
|
23
|
+
attr_accessor :last_report
|
24
24
|
|
25
25
|
# Configures the gem.
|
26
26
|
#
|
@@ -74,6 +74,11 @@ module Rollbar
|
|
74
74
|
# @param person_data [Hash] Data describing the affected person. Should be the result of calling
|
75
75
|
# `rollbar_person_data`
|
76
76
|
def report_exception(exception, request_data = nil, person_data = nil, level = nil)
|
77
|
+
if person_data.present?
|
78
|
+
person_id = person_data[Rollbar.configuration.person_id_method.to_sym]
|
79
|
+
return 'ignored' if configuration.ignored_person_ids.include?(person_id)
|
80
|
+
end
|
81
|
+
|
77
82
|
return 'disabled' unless configuration.enabled
|
78
83
|
return 'ignored' if ignored?(exception)
|
79
84
|
|
@@ -345,12 +350,12 @@ module Rollbar
|
|
345
350
|
|
346
351
|
def base_data(level = 'error')
|
347
352
|
config = configuration
|
348
|
-
|
353
|
+
|
349
354
|
environment = config.environment
|
350
355
|
if environment.nil? || environment.empty?
|
351
356
|
environment = 'unspecified'
|
352
357
|
end
|
353
|
-
|
358
|
+
|
354
359
|
data = {
|
355
360
|
:timestamp => Time.now.to_i,
|
356
361
|
:environment => environment,
|
@@ -15,6 +15,7 @@ module Rollbar
|
|
15
15
|
attr_accessor :exception_level_filters
|
16
16
|
attr_accessor :filepath
|
17
17
|
attr_accessor :framework
|
18
|
+
attr_accessor :ignored_person_ids
|
18
19
|
attr_accessor :logger
|
19
20
|
attr_accessor :person_method
|
20
21
|
attr_accessor :person_id_method
|
@@ -46,6 +47,7 @@ module Rollbar
|
|
46
47
|
'ActionController::RoutingError' => 'warning'
|
47
48
|
}
|
48
49
|
@framework = 'Plain'
|
50
|
+
@ignored_person_ids = []
|
49
51
|
@person_method = 'current_user'
|
50
52
|
@person_id_method = 'id'
|
51
53
|
@person_username_method = 'username'
|
data/lib/rollbar/version.rb
CHANGED
data/spec/rollbar_spec.rb
CHANGED
@@ -127,6 +127,47 @@ describe Rollbar do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
it 'should ignore ignored persons' do
|
131
|
+
Rollbar.configure do |config|
|
132
|
+
config.ignored_person_ids += [1]
|
133
|
+
end
|
134
|
+
|
135
|
+
logger_mock.should_not_receive(:info)
|
136
|
+
logger_mock.should_not_receive(:warn)
|
137
|
+
logger_mock.should_not_receive(:error)
|
138
|
+
|
139
|
+
person_data = {
|
140
|
+
:id => 1,
|
141
|
+
:username => "test",
|
142
|
+
:email => "test@example.com"
|
143
|
+
}
|
144
|
+
Rollbar.report_exception(@exception, {}, person_data)
|
145
|
+
end
|
146
|
+
|
147
|
+
it 'should not ignore non-ignored persons' do
|
148
|
+
Rollbar.configure do |config|
|
149
|
+
config.ignored_person_ids += [1]
|
150
|
+
end
|
151
|
+
|
152
|
+
Rollbar.last_report = nil
|
153
|
+
|
154
|
+
person_data = {
|
155
|
+
:id => 1,
|
156
|
+
:username => "test",
|
157
|
+
:email => "test@example.com"
|
158
|
+
}
|
159
|
+
Rollbar.report_exception(@exception, {}, person_data)
|
160
|
+
Rollbar.last_report.should be_nil
|
161
|
+
|
162
|
+
person_data = {
|
163
|
+
:id => 2,
|
164
|
+
:username => "test2",
|
165
|
+
:email => "test2@example.com"
|
166
|
+
}
|
167
|
+
Rollbar.report_exception(@exception, {}, person_data)
|
168
|
+
Rollbar.last_report.should_not be_nil
|
169
|
+
end
|
170
|
+
|
130
171
|
it 'should allow callables to set exception filtered level' do
|
131
172
|
callable_mock = double
|
132
173
|
saved_filters = Rollbar.configuration.exception_level_filters
|
@@ -692,7 +733,7 @@ describe Rollbar do
|
|
692
733
|
@dummy_class = DummyClass.new
|
693
734
|
@dummy_class.extend(Rollbar::RequestDataExtractor)
|
694
735
|
end
|
695
|
-
|
736
|
+
|
696
737
|
context "rollbar_headers" do
|
697
738
|
it "should not include cookies" do
|
698
739
|
env = {"HTTP_USER_AGENT" => "test", "HTTP_COOKIE" => "cookie"}
|