rollbar 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.9.3**
4
+ - Added configuration setting to specify gems that should be considered part of the Rollbar project, making frames from these gems show up automatically uncollapsed in tracebacks appearing on the website.
5
+
3
6
  **0.9.2**
4
7
  - Added [Capistrano integration](https://github.com/rollbar/rollbar-gem/pull/27)
5
8
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rollbar [![Build Status](https://secure.travis-ci.org/rollbar/rollbar-gem.png?branch=master)](https://travis-ci.org/rollbar/rollbar-gem)
2
2
 
3
- Ruby gem for Rollbar, for reporting exceptions in Rails 3 to Rollbar. Requires a Rollbar account (you can sign up for free).
3
+ Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https://rollbar.com). Requires a Rollbar account (you can [sign up for free](https://rollbar.com/signup)). Basic integration in a Rails 3 app should only take a few minutes.
4
4
 
5
5
  ## Installation
6
6
 
@@ -24,6 +24,8 @@ module Rollbar
24
24
  attr_accessor :use_eventmachine
25
25
  attr_accessor :web_base
26
26
  attr_accessor :write_to_file
27
+
28
+ attr_reader :project_gem_paths
27
29
 
28
30
  DEFAULT_ENDPOINT = 'https://api.rollbar.com/api/1/item/'
29
31
  DEFAULT_WEB_BASE = 'https://rollbar.com'
@@ -43,18 +45,34 @@ module Rollbar
43
45
  @person_id_method = 'id'
44
46
  @person_username_method = 'username'
45
47
  @person_email_method = 'email'
48
+ @project_gems = []
46
49
  @scrub_fields = [:passwd, :password, :password_confirmation, :secret,
47
50
  :confirm_password, :password_confirmation]
48
51
  @use_async = false
52
+ @use_eventmachine = false
49
53
  @web_base = DEFAULT_WEB_BASE
50
54
  @write_to_file = false
51
- @use_eventmachine = false
52
55
  end
53
56
 
54
57
  def use_eventmachine=(value)
55
58
  require 'em-http-request' if value
56
59
  @use_eventmachine = value
57
60
  end
61
+
62
+ def project_gems=(gems)
63
+ @project_gem_paths = []
64
+
65
+ gems.each { |name|
66
+ begin
67
+ spec = Gem::Specification.find_by_name(name.to_s)
68
+ gem_root = spec.gem_dir
69
+
70
+ @project_gem_paths.push gem_root
71
+ rescue Gem::LoadError
72
+ puts "[Rollbar] #{name} gem not found"
73
+ end
74
+ }
75
+ end
58
76
 
59
77
  # allow params to be read like a hash
60
78
  def [](option)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
data/lib/rollbar.rb CHANGED
@@ -322,6 +322,7 @@ module Rollbar
322
322
  :level => level,
323
323
  :language => 'ruby',
324
324
  :framework => config.framework,
325
+ :project_package_paths => config.project_gem_paths,
325
326
  :notifier => {
326
327
  :name => 'rollbar-gem',
327
328
  :version => VERSION
data/spec/rollbar_spec.rb CHANGED
@@ -413,6 +413,29 @@ describe Rollbar do
413
413
  data[:branch].should == 'master'
414
414
  end
415
415
  end
416
+
417
+ context "project_gems" do
418
+ it "should include gem paths for specified project gems in the payload" do
419
+ gems = ['rack', 'rspec-rails']
420
+ gem_paths = []
421
+
422
+ Rollbar.configure do |config|
423
+ config.project_gems = gems
424
+ end
425
+
426
+ gems.each {|gem|
427
+ gem_paths.push(Gem::Specification.find_by_name(gem).gem_dir)
428
+ }
429
+
430
+ data = Rollbar.send(:message_data, 'test', 'info', {})
431
+ data[:project_package_paths].kind_of?(Array).should == true
432
+ data[:project_package_paths].length.should == gem_paths.length
433
+
434
+ data[:project_package_paths].each_with_index{|path, index|
435
+ path.should == gem_paths[index]
436
+ }
437
+ end
438
+ end
416
439
 
417
440
  # configure with some basic params
418
441
  def configure
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.9.2
4
+ version: 0.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -282,3 +282,4 @@ test_files:
282
282
  - spec/rollbar_spec.rb
283
283
  - spec/spec_helper.rb
284
284
  - spec/support/devise.rb
285
+ has_rdoc: