rollbar 1.4.0 → 1.4.1

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: 7162276edce6487cb188a1ae5b7bacfd690f5f8f
4
- data.tar.gz: d9f6433968083985d404cc46ce34d5607e46b7ff
3
+ metadata.gz: f74dc5fc9ff24bdca6794e33d2b5b97b7d431c32
4
+ data.tar.gz: 40d644a903089a249e2f745cd419c563d666886e
5
5
  SHA512:
6
- metadata.gz: f689341a99194085a8f73f2e28c52dbce73ed44ad0bf9e81066cfd3aa7ca90e4a2ef071dd1c1e07ecb1ae80b6141f2fc5c901f7293baea0dfe64c048f4dec355
7
- data.tar.gz: 447bfcd210fa8bd59eb05ee72cd53fa6a623019f76dd4c14eefd0e015c0a336e427b6f6dd7e432779199fc9fc76485c0cdd8cc1e4d7785b89d8fed5e11020889
6
+ metadata.gz: c8cf1b1c07b04b0a14487d38209206cea6c360a4c901c776061cfbf67808443fce33fa4726f2dbac0d29ac52b180e07fbc8b564c5f9a852a6062e5b31e6ae811
7
+ data.tar.gz: 49f9c3af52d8933fd5241bd6a344d85ecc52716243d485f2558bcdf89dda9506e3dc5b51b789b87a7d9776ee12ee0c4c3a2761dd3e59054f646285f133884875
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.4.1
4
+
5
+ Bug fixes:
6
+
7
+ - Fix internal error when ActiveRecord was present, but not used. See [#204](https://github.com/rollbar/rollbar-gem/pull/204)
8
+
3
9
  ## 1.4.0
4
10
 
5
11
  Possible breaking changes:
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.0)](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.1)](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.0'
12
+ gem 'rollbar', '~> 1.4.1'
13
13
 
14
14
  And then execute:
15
15
 
@@ -232,6 +232,57 @@ Rollbar.configure do |config|
232
232
  end
233
233
  ```
234
234
 
235
+ ### Person tracking with Rack applications
236
+
237
+ To track information about the current user in non-Rails applications, you can populate the `rollbar.person_data` key in the Rack environment with the desired data. Its value should be a hash like:
238
+
239
+ ```ruby
240
+ {
241
+ :id => "123", # required; string up to 40 characters
242
+ :username => "adalovelace", # optional; string up to 255 characters
243
+ :email => "ada@lovelace.net" # optional; string up to 255 characters
244
+ }
245
+ ```
246
+
247
+ Because Rack applications can vary so widely, we don't provide a default implementation in the gem, but here is an example middleware:
248
+
249
+ ```ruby
250
+ class RollbarPersonData
251
+ def initialize(app)
252
+ @app = app
253
+ end
254
+
255
+ def call(env)
256
+ token = Rack::Request.new(env).params['token']
257
+ user = User.find_by_token(token)
258
+
259
+ if user
260
+ env['rollbar.person_data'] = extract_person_data(user)
261
+ end
262
+
263
+ @app.call(env)
264
+ end
265
+
266
+ def extract_person_data(user)
267
+ {
268
+ id: user.id,
269
+ username: user.username,
270
+ email: user.email
271
+ }
272
+ end
273
+ end
274
+
275
+ # You can add the middleware to your application, for ex:
276
+
277
+ class App < Sinatra::Base
278
+ use Rollbar::Middleware::Sinatra
279
+ use RollbarPersonData
280
+
281
+ # ...
282
+ # ...
283
+ end
284
+ ```
285
+
235
286
  ## Special note about reporting within a request
236
287
 
237
288
  The gem instantiates one `Notifier` instance on initialization, which will be the base notifier that is used for all reporting (via a `method_missing` proxy in the `Rollbar` module). Calling `Rollbar.configure()` will configure this base notifier that will be used globally in a ruby app.
data/THANKS.md CHANGED
@@ -19,6 +19,7 @@ Huge thanks to the following contributors (by github username). For the most up-
19
19
  - [gdeglin](https://github.com/gdeglin)
20
20
  - [gersmann](https://github.com/gersmann)
21
21
  - [grosser](https://github.com/grosser)
22
+ - [GUI](https://github.com/GUI)
22
23
  - [ixti](https://github.com/ixti)
23
24
  - [jeremyvdw](https://github.com/jeremyvdw)
24
25
  - [johnknott](https://github.com/johnknott)
@@ -60,7 +60,7 @@ module Rollbar
60
60
 
61
61
  def person_data_proc(env)
62
62
  block = proc { extract_person_data_from_controller(env) }
63
- return block unless defined?(ActiveRecord::Base)
63
+ return block unless(defined?(ActiveRecord::Base) && ActiveRecord::Base.connected?)
64
64
 
65
65
  proc { ActiveRecord::Base.connection_pool.with_connection(&block) }
66
66
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  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.4.0
4
+ version: 1.4.1
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-13 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json