rollbar 0.10.9 → 0.10.10

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.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.10.10**
4
+ - Add support for sucker_punch asynchronous handling
5
+
3
6
  **0.10.9**
4
7
  - Fix regression introduced in 0.10.7 when ActiveRecord is not present.
5
8
 
data/Gemfile CHANGED
@@ -5,5 +5,4 @@ gemspec
5
5
  gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
6
6
  gem 'jruby-openssl', :platform => :jruby
7
7
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
8
- gem 'girl_friday'
9
8
  gem 'appraisal'
data/THANKS.md CHANGED
@@ -5,6 +5,7 @@ Huge thanks to the following contributors (by github username). For the most up-
5
5
  - [arr-ee](https://github.com/arr-ee)
6
6
  - [awmichel](https://github.com/awmichel)
7
7
  - [dimko](https://github.com/dimko)
8
+ - [dlackty](https://github.com/dlackty)
8
9
  - [fabsays](https://github.com/fabsays)
9
10
  - [firstbanco](https://github.com/firstbanco)
10
11
  - [ixti](https://github.com/ixti)
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
6
  gem "jruby-openssl", :platform=>:jruby
7
7
  gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
- gem "girl_friday"
9
8
  gem "appraisal"
10
9
  gem "rails", "3.0.20"
11
10
 
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
6
  gem "jruby-openssl", :platform=>:jruby
7
7
  gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
- gem "girl_friday"
9
8
  gem "appraisal"
10
9
  gem "rails", "3.1.12"
11
10
 
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
6
  gem "jruby-openssl", :platform=>:jruby
7
7
  gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
- gem "girl_friday"
9
8
  gem "appraisal"
10
9
  gem "rails", "3.2.12"
11
10
 
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
6
6
  gem "jruby-openssl", :platform=>:jruby
7
7
  gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
8
- gem "girl_friday"
9
8
  gem "appraisal"
10
9
  gem "rails", "4.0.0"
11
10
  gem "protected_attributes"
data/lib/rollbar.rb CHANGED
@@ -6,6 +6,7 @@ require 'thread'
6
6
  require 'uri'
7
7
 
8
8
  require 'girl_friday' if defined?(GirlFriday)
9
+ require 'sucker_punch' if defined?(SuckerPunch)
9
10
  require 'multi_json'
10
11
 
11
12
  require 'rollbar/version'
@@ -22,11 +22,12 @@ module Rollbar
22
22
  attr_accessor :root
23
23
  attr_accessor :scrub_fields
24
24
  attr_accessor :use_sidekiq
25
+ attr_accessor :use_sucker_punch
25
26
  attr_accessor :use_async
26
27
  attr_accessor :use_eventmachine
27
28
  attr_accessor :web_base
28
29
  attr_accessor :write_to_file
29
-
30
+
30
31
  attr_reader :project_gem_paths
31
32
 
32
33
  DEFAULT_ENDPOINT = 'https://api.rollbar.com/api/1/item/'
@@ -54,11 +55,12 @@ module Rollbar
54
55
  :confirm_password, :password_confirmation, :secret_token]
55
56
  @use_async = false
56
57
  @use_sidekiq = false
58
+ @use_sucker_punch = false
57
59
  @use_eventmachine = false
58
60
  @web_base = DEFAULT_WEB_BASE
59
61
  @write_to_file = false
60
62
  end
61
-
63
+
62
64
  def use_sidekiq=(value)
63
65
  if value
64
66
  require 'rollbar/delay/sidekiq' if defined?(Sidekiq)
@@ -67,19 +69,27 @@ module Rollbar
67
69
  end
68
70
  end
69
71
 
72
+ def use_sucker_punch=(value)
73
+ if value
74
+ require 'rollbar/delay/sucker_punch' if defined?(SuckerPunch)
75
+ @use_async = true
76
+ @async_handler = Rollbar::Delay::SuckerPunch.method(:handle)
77
+ end
78
+ end
79
+
70
80
  def use_eventmachine=(value)
71
81
  require 'em-http-request' if value
72
82
  @use_eventmachine = value
73
83
  end
74
-
84
+
75
85
  def project_gems=(gems)
76
86
  @project_gem_paths = []
77
-
87
+
78
88
  gems.each { |name|
79
89
  begin
80
90
  spec = Gem::Specification.find_by_name(name.to_s)
81
91
  gem_root = spec.gem_dir
82
-
92
+
83
93
  @project_gem_paths.push gem_root
84
94
  rescue Gem::LoadError
85
95
  puts "[Rollbar] #{name} gem not found"
@@ -0,0 +1,18 @@
1
+ require 'sucker_punch'
2
+
3
+ module Rollbar
4
+ module Delay
5
+ class SuckerPunch
6
+ def self.handle(payload)
7
+ @@sucker_punch_worker ||= self.new
8
+ @@sucker_punch_worker.async.perform payload
9
+ end
10
+
11
+ include ::SuckerPunch::Job
12
+
13
+ def perform(*args)
14
+ Rollbar.process_payload(*args)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -54,7 +54,10 @@ namespace :rollbar do
54
54
 
55
55
  puts "Processing..."
56
56
  env = Rack::MockRequest.env_for("/verify")
57
-
58
- Rails.application.call(env)
57
+ status, headers, response = Rails.application.call(env)
58
+
59
+ unless status == 500
60
+ puts "Test failed! You may have a configuration issue, or you could be using a gem that's blocking the test. Contact support@rollbar.com if you need help troubleshooting."
61
+ end
59
62
  end
60
63
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.10.9"
2
+ VERSION = "0.10.10"
3
3
  end
data/rollbar.gemspec CHANGED
@@ -21,5 +21,6 @@ Gem::Specification.new do |gem|
21
21
  gem.add_development_dependency 'rspec-rails', '~> 2.12.0'
22
22
  gem.add_development_dependency 'database_cleaner', '~> 1.0.0'
23
23
  gem.add_development_dependency 'girl_friday', '>= 0.11.1'
24
+ gem.add_development_dependency 'sucker_punch', '>= 1.0.0' if RUBY_VERSION != '1.8.7'
24
25
  gem.add_development_dependency 'genspec', '>= 0.2.7'
25
26
  end
data/spec/rollbar_spec.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  require 'logger'
2
2
  require 'socket'
3
3
  require 'spec_helper'
4
+ require 'girl_friday'
5
+
6
+ begin
7
+ require 'sucker_punch'
8
+ require 'sucker_punch/testing/inline'
9
+ rescue LoadError
10
+ end
4
11
 
5
12
  describe Rollbar do
6
13
 
@@ -170,7 +177,7 @@ describe Rollbar do
170
177
  exception = CustomException.new("oops")
171
178
 
172
179
  Rollbar.report_exception(exception)
173
-
180
+
174
181
  payload["data"]["body"]["trace"]["frames"][0]["method"].should == "custom backtrace line"
175
182
  end
176
183
  end
@@ -344,6 +351,25 @@ describe Rollbar do
344
351
  end
345
352
  end
346
353
 
354
+ if defined?(SuckerPunch)
355
+ it "should send the payload to sucker_punch delayer" do
356
+ logger_mock.should_receive(:info).with('[Rollbar] Scheduling payload')
357
+ logger_mock.should_receive(:info).with('[Rollbar] Sending payload')
358
+ logger_mock.should_receive(:info).with('[Rollbar] Success')
359
+
360
+ Rollbar.configure do |config|
361
+ config.use_sucker_punch = true
362
+ end
363
+
364
+ Rollbar.report_exception(@exception)
365
+
366
+ Rollbar.configure do |config|
367
+ config.use_async = false
368
+ config.async_handler = Rollbar.method(:default_async_handler)
369
+ end
370
+ end
371
+ end
372
+
347
373
  it "should send the payload to sidekiq delayer" do
348
374
  module Rollbar
349
375
  module Delay
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.10.9
4
+ version: 0.10.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-07 00:00:00.000000000 Z
12
+ date: 2013-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.11.1
94
+ - !ruby/object:Gem::Dependency
95
+ name: sucker_punch
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 1.0.0
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.0
94
110
  - !ruby/object:Gem::Dependency
95
111
  name: genspec
96
112
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +152,7 @@ files:
136
152
  - lib/rollbar/capistrano.rb
137
153
  - lib/rollbar/configuration.rb
138
154
  - lib/rollbar/delay/sidekiq.rb
155
+ - lib/rollbar/delay/sucker_punch.rb
139
156
  - lib/rollbar/delayed_job.rb
140
157
  - lib/rollbar/exception_reporter.rb
141
158
  - lib/rollbar/goalie.rb