delayed_job_extras 0.13.1 → 0.13.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
|
|
1
|
+
if defined?(ActionMailer)
|
2
|
+
|
3
|
+
module Mail
|
4
|
+
class Message
|
5
|
+
|
6
|
+
class MailmanWorker < DJ::Worker
|
7
|
+
priority :immediate
|
8
|
+
|
9
|
+
def perform
|
10
|
+
message = Marshal.load(self.mail)
|
11
|
+
message.deliver_without_worker
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def deliver_with_worker
|
16
|
+
if ActionMailer::Base.delivery_method == :test
|
17
|
+
deliver_without_worker
|
18
|
+
else
|
19
|
+
Mail::Message::MailmanWorker.enqueue(:mail => Marshal.dump(self))
|
20
|
+
return self
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
alias_method_chain :deliver, :worker
|
25
|
+
|
26
|
+
end # Base
|
27
|
+
end # ActionMailer
|
28
|
+
|
29
|
+
end
|
data/lib/delayed_job_extras.rb
CHANGED
@@ -9,13 +9,15 @@ require File.join(path, 'extras')
|
|
9
9
|
require File.join(path, 'job')
|
10
10
|
require File.join(path, 'performable_method')
|
11
11
|
require File.join(path, 'worker')
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
require File.join(path, 'hoptoad')
|
15
15
|
# require File.join(path, 'acts_as_paranoid')
|
16
16
|
|
17
17
|
if Rails.version.match(/^2/)
|
18
|
+
require File.join(path, 'action_mailer')
|
18
19
|
require File.join(path, 'validate_with_unique')
|
19
20
|
else
|
21
|
+
# require File.join(path, 'action_mailer_rails3')
|
20
22
|
require File.join(path, 'unique_dj_validator')
|
21
23
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 13
|
8
|
-
-
|
9
|
-
version: 0.13.
|
8
|
+
- 4
|
9
|
+
version: 0.13.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- markbates
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-22 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -40,6 +40,7 @@ extra_rdoc_files:
|
|
40
40
|
- LICENSE
|
41
41
|
files:
|
42
42
|
- lib/delayed_job_extras/action_mailer.rb
|
43
|
+
- lib/delayed_job_extras/action_mailer_rails3.rb
|
43
44
|
- lib/delayed_job_extras/acts_as_paranoid.rb
|
44
45
|
- lib/delayed_job_extras/extras.rb
|
45
46
|
- lib/delayed_job_extras/hoptoad.rb
|