ratchetio 0.4.11 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/lib/ratchetio/delayed_job.rb +25 -0
- data/lib/ratchetio/version.rb +1 -1
- data/lib/ratchetio.rb +1 -0
- metadata +3 -2
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/ratchetio/version.rb
CHANGED
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
|
+
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-
|
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
|