rollbar 1.2.1 → 1.2.2

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: 3cfe303ae73dcfd7cfaff61a78a3d189205b7bcc
4
- data.tar.gz: 327509998ddc5c03907fd30190ac7f087de12187
3
+ metadata.gz: 1a432f94f474059f9731e64f22f23963c4b3926e
4
+ data.tar.gz: 0ccbc7ed06b952be8139592dcc7e40ca8ff396be
5
5
  SHA512:
6
- metadata.gz: 95207004e19203386da2851e762a0301694e7e7d6385608cd2acdcc04076fb9c6ee0ba4be4ac8d37fcd1697936f5797d2559c92ba0a87b546db6c0cb4b4d7e0e
7
- data.tar.gz: 70541207c0df4a50eac2ee39622ffb806f7561684ce1bdfcd9c8731fb0197411674adf058e2cb2deac4f02991336228f41162a963e9a7d29e0de0acb88682ea0
6
+ metadata.gz: 098d37ecd9ba8c011bc73fb23da48d90d19c70d123a455412ede696de8b22c369a76b3a80fb9d8874afc6c7ab3c2dadda2a205ad1b7e8430f3e68339d68b837d
7
+ data.tar.gz: ba67c227bd1f08f21943cfcfa58a043c0be64845d5e98b227456fac58caecb2713110322c1c10482d14ef2e490a12fcfaf7c2eb5b80c37a198211fd7e3460c72
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ **1.2.2**
4
+ - Fix issue with delayed_job and Rollbar.report_exception (bug introduced in 1.2.0). See [#145](https://github.com/rollbar/rollbar-gem/issues/145)
5
+ - Explicitly require 'rack' in request_data_extractor. See [#144](https://github.com/rollbar/rollbar-gem/pull/144)
6
+
3
7
  **1.2.1**
4
8
  - Revert change made as part of 1.2.0 where all procs in the payload would be evaluated. See [#143](https://github.com/rollbar/rollbar-gem/pull/143).
5
9
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https:/
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'rollbar', '~> 1.2.0'
12
+ gem 'rollbar', '~> 1.2.1'
13
13
 
14
14
  And then execute:
15
15
 
@@ -733,31 +733,30 @@ module Rollbar
733
733
 
734
734
  # Backwards compatibility methods
735
735
 
736
- def report_exception(exception, request_data = {}, person_data = {}, level = 'error')
736
+ def report_exception(exception, request_data = nil, person_data = nil, level = 'error')
737
737
  Kernel.warn('[DEPRECATION] Rollbar.report_exception has been deprecated, please use log() or one of the level functions')
738
738
 
739
739
  scope = {}
740
- scope[:request] = request_data if request_data && request_data.any?
741
- scope[:person] = person_data if person_data && person_data.any?
740
+ scope[:request] = request_data if request_data
741
+ scope[:person] = person_data if person_data
742
742
 
743
743
  Rollbar.scoped(scope) do
744
744
  Rollbar.notifier.log(level, exception)
745
745
  end
746
746
  end
747
747
 
748
- def report_message(message, level = 'info', extra_data = {})
748
+ def report_message(message, level = 'info', extra_data = nil)
749
749
  Kernel.warn('[DEPRECATION] Rollbar.report_message has been deprecated, please use log() or one of the level functions')
750
750
 
751
751
  Rollbar.notifier.log(level, message, extra_data)
752
752
  end
753
753
 
754
- def report_message_with_request(message, level = 'info', request_data = {}, person_data = {}, extra_data = {})
754
+ def report_message_with_request(message, level = 'info', request_data = nil, person_data = nil, extra_data = nil)
755
755
  Kernel.warn('[DEPRECATION] Rollbar.report_message_with_request has been deprecated, please use log() or one of the level functions')
756
756
 
757
757
  scope = {}
758
- scope[:request] = request_data if request_data && request_data.any?
759
- scope[:person] = person_data if person_data && person_data.any?
760
-
758
+ scope[:request] = request_data if request_data
759
+ scope[:person] = person_data if person_data
761
760
 
762
761
  Rollbar.scoped(:request => request_data, :person => person_data) do
763
762
  Rollbar.notifier.log(level, message, extra_data)
@@ -1,4 +1,5 @@
1
1
  require 'multi_json'
2
+ require 'rack'
2
3
 
3
4
  module Rollbar
4
5
  module RequestDataExtractor
@@ -14,7 +15,7 @@ module Rollbar
14
15
  end
15
16
 
16
17
  def extract_request_data_from_rack(env)
17
- rack_req = Rack::Request.new(env)
18
+ rack_req = ::Rack::Request.new(env)
18
19
 
19
20
  sensitive_params = sensitive_params_list(env)
20
21
  request_params = rollbar_filtered_params(sensitive_params, rollbar_request_params(env))
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -26,4 +26,5 @@ Gem::Specification.new do |gem|
26
26
  gem.add_development_dependency 'genspec', '>= 0.2.7'
27
27
  gem.add_development_dependency 'sinatra'
28
28
  gem.add_development_dependency 'resque'
29
+ gem.add_development_dependency 'delayed_job'
29
30
  end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+ require 'delayed_job'
3
+ require 'rollbar/delayed_job'
4
+
5
+ describe Rollbar::Delayed do
6
+ class FailingJob
7
+ class TestException < Exception; end
8
+
9
+ def perform
10
+ fail(TestException, 'failing')
11
+ end
12
+ end
13
+
14
+ module DummyBackend
15
+ class Job
16
+ include Delayed::Backend::Base
17
+
18
+ attr_accessor :handler, :attempts
19
+
20
+ def initialize(options = {})
21
+ @payload_object = options[:payload_object]
22
+ @attempts = 0
23
+ end
24
+ end
25
+ end
26
+
27
+ let(:logger) { Rollbar.logger }
28
+
29
+ before do
30
+ Rollbar::Delayed.wrap_worker
31
+ Delayed::Worker.delay_jobs = false
32
+ Delayed::Worker.backend = DummyBackend::Job
33
+ end
34
+
35
+ it 'sends the exception' do
36
+ expect do
37
+ Delayed::Job.enqueue(FailingJob.new)
38
+ end.to raise_error(FailingJob::TestException)
39
+
40
+ last_report = Rollbar.last_report
41
+ expect(last_report[:request]).to be_kind_of(DummyBackend::Job)
42
+ end
43
+ end
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: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-17 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: delayed_job
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  description: Rails plugin to catch and send exceptions to Rollbar
154
168
  email:
155
169
  - support@rollbar.com
@@ -267,6 +281,7 @@ files:
267
281
  - spec/rollbar/delay/girl_friday_spec.rb
268
282
  - spec/rollbar/delay/resque_spec.rb
269
283
  - spec/rollbar/delay/thread_spec.rb
284
+ - spec/rollbar/delayed_job_spec.rb
270
285
  - spec/rollbar/logger_proxy_spec.rb
271
286
  - spec/rollbar/middleware/rack/builder_spec.rb
272
287
  - spec/rollbar/middleware/sinatra_spec.rb
@@ -358,6 +373,7 @@ test_files:
358
373
  - spec/rollbar/delay/girl_friday_spec.rb
359
374
  - spec/rollbar/delay/resque_spec.rb
360
375
  - spec/rollbar/delay/thread_spec.rb
376
+ - spec/rollbar/delayed_job_spec.rb
361
377
  - spec/rollbar/logger_proxy_spec.rb
362
378
  - spec/rollbar/middleware/rack/builder_spec.rb
363
379
  - spec/rollbar/middleware/sinatra_spec.rb