rollbar 1.2.12 → 1.2.13

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: d7d45f060a4cd05cfc90f7594dea1826eb5d7e0f
4
- data.tar.gz: 0c877c9d5dab1ccdade96748f28cf7268e03865c
3
+ metadata.gz: 7c9a546f13548ef6139126d589b9491103e54a13
4
+ data.tar.gz: 3e36ffd724fb07d6bbfb3758adfa5becf98d5dee
5
5
  SHA512:
6
- metadata.gz: 3b87159bca2a58f15dbb5550d7861b5a80209cb2ce62b624559e3a6f7ff768110fec7e9a379ad9e7943dfcc9af3910cafb1ce49a32eca101f1b7295544fbe036
7
- data.tar.gz: e3050f14f5a86a5773368cb424762c05e930a125da0d35fe92535553261a649acb7118250b48711fad800453a9c6380dc6fb5be6ba4b7099af8b10b967b9e4c8
6
+ metadata.gz: d4b1d68005a5af7ba02208d198dcc91753fffa25d02178103942efe0474154478cf41e8e70b140f6ef99f5eb246f598066d257664ed5147daa30c3c820a23f1d
7
+ data.tar.gz: 37b8bf25763ad0d623dba71f1184785d328a0998c174413ecd9c594d5cf1027ff7a17b32c1a5ad87e0c10cae2831b301917971b365a681870d22ac90428fd4d1
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.2.13
4
+
5
+ New features:
6
+
7
+ - Person tracking for Rack/Sinatra apps. See [#192](https://github.com/rollbar/rollbar-gem/pull/192)
8
+
9
+ Bug fixes:
10
+
11
+ - Fix `rollbar:test` rake task (regression from 1.2.12); see [985c091](https://github.com/vyrak/rollbar-gem/commit/985c091ad58ae4f4c6997dd356497b4e5a2be498)
12
+
3
13
  ## 1.2.12
4
14
 
5
15
  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.2.12)](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.2.13)](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.2.12'
12
+ gem 'rollbar', '~> 1.2.13'
13
13
 
14
14
  And then execute:
15
15
 
data/THANKS.md CHANGED
@@ -44,4 +44,5 @@ Huge thanks to the following contributors (by github username). For the most up-
44
44
  - [siong1987](https://github.com/siong1987)
45
45
  - [trisweb](https://github.com/trisweb)
46
46
  - [tysontate](https://github.com/tysontate)
47
+ - [vyrak](https://github.com/vyrak)
47
48
  - [wbond](https://github.com/wbond)
@@ -23,12 +23,19 @@ module Rollbar
23
23
 
24
24
  def fetch_scope(env)
25
25
  request_data = extract_request_data_from_rack(env)
26
- { :request => request_data }
26
+ {
27
+ :request => request_data,
28
+ :person => person_data_proc(env)
29
+ }
27
30
  rescue Exception => e
28
31
  report_exception_to_rollbar(env, e)
29
32
  raise
30
33
  end
31
34
 
35
+ def person_data_proc(env)
36
+ proc { extract_person_data_from_controller(env) }
37
+ end
38
+
32
39
  def self.included(base)
33
40
  base.send(:alias_method, :call_without_rollbar, :call)
34
41
  base.send(:alias_method, :call, :call_with_rollbar)
@@ -29,12 +29,19 @@ module Rollbar
29
29
 
30
30
  def fetch_scope(env)
31
31
  request_data = extract_request_data_from_rack(env)
32
- { :request => request_data }
32
+ {
33
+ :request => request_data,
34
+ :person => person_data_proc(env)
35
+ }
33
36
  rescue Exception => e
34
37
  report_exception_to_rollbar(env, e)
35
38
  raise
36
39
  end
37
40
 
41
+ def person_data_proc(env)
42
+ proc { extract_person_data_from_controller(env) }
43
+ end
44
+
38
45
  def framework_error(env)
39
46
  env['sinatra.error']
40
47
  end
@@ -1,3 +1,5 @@
1
+ require 'rollbar/util/hash'
2
+
1
3
  module Rollbar
2
4
  module Util
3
5
  def self.iterate_and_update(obj, block)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.2.12"
2
+ VERSION = "1.2.13"
3
3
  end
@@ -126,4 +126,26 @@ describe Rollbar::Middleware::Rack::Builder, :reconfigure_notifier => true do
126
126
  expect(last_report[:request][:url]).to match(/https:/)
127
127
  end
128
128
  end
129
+
130
+ context 'with person data' do
131
+ let(:person_data) do
132
+ { 'email' => 'person@example.com' }
133
+ end
134
+
135
+ it 'includes person data from env' do
136
+ expect do
137
+ request.get('/will_crash', 'rollbar.person_data' => person_data)
138
+ end.to raise_error(exception)
139
+
140
+ expect(Rollbar.last_report[:person]).to be_eql(person_data)
141
+ end
142
+
143
+ it 'includes empty person data when not in env' do
144
+ expect do
145
+ request.get('/will_crash')
146
+ end.to raise_error(exception)
147
+
148
+ expect(Rollbar.last_report[:person]).to be_eql({})
149
+ end
150
+ end
129
151
  end
@@ -162,5 +162,28 @@ describe Rollbar::Middleware::Sinatra, :reconfigure_notifier => true do
162
162
 
163
163
  expect(id1).not_to be_eql(id2)
164
164
  end
165
+
166
+ context 'with person data' do
167
+ let(:exception) { kind_of(SinatraDummy::DummyError) }
168
+ let(:person_data) do
169
+ { 'email' => 'person@example.com' }
170
+ end
171
+
172
+ it 'includes person data from env' do
173
+ expect do
174
+ get '/foo', {}, 'rollbar.person_data' => person_data
175
+ end.to raise_error(exception)
176
+
177
+ expect(Rollbar.last_report[:person]).to be_eql(person_data)
178
+ end
179
+
180
+ it 'includes empty person data when not in env' do
181
+ expect do
182
+ get '/foo'
183
+ end.to raise_error(exception)
184
+
185
+ expect(Rollbar.last_report[:person]).to be_eql({})
186
+ end
187
+ end
165
188
  end
166
189
  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.12
4
+ version: 1.2.13
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-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json