ratchetio 0.4.11 → 0.5.0

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.5.0**
4
+ - Add support to report exceptions raised in delayed_job.
5
+
3
6
  **0.4.10**
4
7
  - Fix compatability issue with ruby 1.8
5
8
 
@@ -0,0 +1,25 @@
1
+ # based on http://bit.ly/VGdfVI
2
+
3
+ module Delayed
4
+ module Plugins
5
+ class Ratchetio < Plugin
6
+ module ReportErrors
7
+ def error(job, error)
8
+ # send the job object as the 'request data'
9
+ ::Ratchetio.report_exception(error, job)
10
+ super if defined?(super)
11
+ end
12
+ end
13
+
14
+ callbacks do |lifecycle|
15
+ lifecycle.before(:invoke_job) do |job|
16
+ payload = job.payload_object
17
+ payload = payload.object if payload.is_a? Delayed::PerformableMethod
18
+ payload.extend ReportErrors
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ Delayed::Worker.plugins << Delayed::Plugins::Ratchetio
@@ -1,3 +1,3 @@
1
1
  module Ratchetio
2
- VERSION = "0.4.11"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/ratchetio.rb CHANGED
@@ -7,6 +7,7 @@ require 'uri'
7
7
  require "girl_friday" if defined?(GirlFriday)
8
8
 
9
9
  require 'ratchetio/configuration'
10
+ require 'ratchetio/delayed_job' if defined?(Delayed)
10
11
  require 'ratchetio/goalie' if defined?(Goalie)
11
12
  require 'ratchetio/railtie' if defined?(Rails)
12
13
  require 'ratchetio/version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratchetio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.5.0
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-01-08 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -110,6 +110,7 @@ files:
110
110
  - lib/generators/ratchetio/templates/initializer.rb
111
111
  - lib/ratchetio.rb
112
112
  - lib/ratchetio/configuration.rb
113
+ - lib/ratchetio/delayed_job.rb
113
114
  - lib/ratchetio/goalie.rb
114
115
  - lib/ratchetio/rails.rb
115
116
  - lib/ratchetio/rails/controller_methods.rb