rollbar 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f74dc5fc9ff24bdca6794e33d2b5b97b7d431c32
4
- data.tar.gz: 40d644a903089a249e2f745cd419c563d666886e
3
+ metadata.gz: c71304582c4e3e90c305212907f516cce923104a
4
+ data.tar.gz: 233e2f5605cefcdce34ae82021d176c349c5fbb0
5
5
  SHA512:
6
- metadata.gz: c8cf1b1c07b04b0a14487d38209206cea6c360a4c901c776061cfbf67808443fce33fa4726f2dbac0d29ac52b180e07fbc8b564c5f9a852a6062e5b31e6ae811
7
- data.tar.gz: 49f9c3af52d8933fd5241bd6a344d85ecc52716243d485f2558bcdf89dda9506e3dc5b51b789b87a7d9776ee12ee0c4c3a2761dd3e59054f646285f133884875
6
+ metadata.gz: ea71e508f060e52cc6e80320035fd9f97ad269ba3a7635b1dce6554910ed18f3be0cab12ecb373f2d1f6b9213d28b87d7f85bd470926e26b3b44328adb246d3d
7
+ data.tar.gz: d7399f7773162732ddba0f66f5080818005308d03ab8e4d3e110b966b54d595439f2ccaa5cc16a85b997cd22939d9ec1de2777862e4d9dc675a4004b26d285f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.4.2
4
+
5
+ Bug fixes:
6
+
7
+ - Fix null 'context' in internal error reports. See [#208](https://github.com/rollbar/rollbar-gem/pull/208)
8
+
3
9
  ## 1.4.1
4
10
 
5
11
  Bug fixes:
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=v1.4.1)](https://travis-ci.org/rollbar/rollbar-gem/branches)
1
+ # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v1.4.2)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
2
 
3
3
  <!-- RemoveNext -->
4
4
  Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https://rollbar.com).
@@ -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.4.1'
12
+ gem 'rollbar', '~> 1.4.2'
13
13
 
14
14
  And then execute:
15
15
 
data/lib/rollbar.rb CHANGED
@@ -228,15 +228,8 @@ module Rollbar
228
228
  if data[:person]
229
229
  person_id = data[:person][configuration.person_id_method.to_sym]
230
230
  return 'ignored' if configuration.ignored_person_ids.include?(person_id)
231
-
232
- is_proc = data[:person].respond_to?(:call)
233
- data[:person] = data[:person].call if is_proc
234
231
  end
235
232
 
236
- data[:request] = data[:request].call if data[:request].respond_to?(:call)
237
- data[:context] = data[:context].call if data[:context].respond_to?(:call)
238
- data.delete(:context) unless data[:context]
239
-
240
233
  schedule_payload(payload)
241
234
 
242
235
  log_instance_link(data)
@@ -300,6 +293,14 @@ module Rollbar
300
293
 
301
294
  Rollbar::Util.deep_merge(data, configuration.payload_options)
302
295
 
296
+ data[:person] = data[:person].call if data[:person].respond_to?(:call)
297
+ data[:request] = data[:request].call if data[:request].respond_to?(:call)
298
+ data[:context] = data[:context].call if data[:context].respond_to?(:call)
299
+
300
+ # Our API doesn't allow null context values, so just delete
301
+ # the key if value is nil.
302
+ data.delete(:context) unless data[:context]
303
+
303
304
  payload = {
304
305
  'access_token' => configuration.access_token,
305
306
  'data' => data
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
data/spec/rollbar_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: UTF-8
1
+ # encoding: utf-8
2
2
 
3
3
  require 'logger'
4
4
  require 'socket'
@@ -1490,6 +1490,25 @@ describe Rollbar do
1490
1490
  end
1491
1491
  end
1492
1492
 
1493
+ context 'when reporting internal error with nil context' do
1494
+ let(:context_proc) { proc {} }
1495
+ let(:scoped_notifier) { notifier.scope(:context => context_proc) }
1496
+ let(:exception) { Exception.new }
1497
+ let(:logger_mock) { double("Rails.logger").as_null_object }
1498
+
1499
+ it 'reports successfully' do
1500
+ configure
1501
+
1502
+ Rollbar.configure do |config|
1503
+ config.logger = logger_mock
1504
+ end
1505
+
1506
+ logger_mock.should_receive(:info).with('[Rollbar] Sending payload').once
1507
+ logger_mock.should_receive(:info).with('[Rollbar] Success').once
1508
+ scoped_notifier.send(:report_internal_error, exception)
1509
+ end
1510
+ end
1511
+
1493
1512
  context "request_data_extractor" do
1494
1513
  before(:each) do
1495
1514
  class DummyClass
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.4.1
4
+ version: 1.4.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: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json