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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23c9d47e5d49503a01978ee4d8e4fa00816522de
4
- data.tar.gz: fecba94515d4ed5a804d735d73b54dcdb048edd3
3
+ metadata.gz: 46603900db3bb897dbbdd72baa78f21e8c39ad43
4
+ data.tar.gz: ba03f938cc791c7db382f879e40ace48c582fd51
5
5
  SHA512:
6
- metadata.gz: 5cbab0b59a0cc48c1798c976d3891068a8ce43ed5c3b2419323adb7cd11f79fadf14577448f86890f08a5358284ed123211f585e4c08c3af95a66e835414db17
7
- data.tar.gz: 022d97884a1ff339520f7492ce22fedc77536a710588b47ba2cf37a75e6646fb08d515a2edfeee5eac94040c6afd1a8c5fb3e360d14f2e8d215f1f3228414e74
6
+ metadata.gz: 44e60e68802ca3cd885b8ae927c533d187dd213cac504843fe5edb4430778e26595306a24807f4263ca5798050424cbd7244346f201c61570fef67625d2919a9
7
+ data.tar.gz: 34d2198535bf88d45ed9df35e9c3442427ed5e63b5686c5cc27a764887f76f1918609c23fa8a04d3fa45759c47ed9dca166f3c82944ffb7e93cf7a32ec669319
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.12.6**
4
+ - Added [#78](https://github.com/rollbar/rollbar-gem/pull/78), ability to ignore exceptions from specific persons
5
+
3
6
  **0.12.5**
4
7
  - Fixed SIGSEGV with the delayed_job plugin and Ruby 2.1.0
5
8
 
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
- attr_reader :last_report
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'
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.12.5"
2
+ VERSION = "0.12.6"
3
3
  end
@@ -1,4 +1,3 @@
1
1
  class User < ActiveRecord::Base
2
- # Setup accessible (or protected) attributes for your model
3
2
  attr_accessible :username, :email, :password, :password_confirmation, :remember_me
4
3
  end
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"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5
4
+ version: 0.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Rue