resque_delivery 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'http://rubygems.org'
2
+ gemspec
data/README.md CHANGED
@@ -31,7 +31,7 @@ You can configure 2 additional options in your resque_delivery_settings hash:
31
31
 
32
32
  ## Notes
33
33
 
34
- We serialize the Mail::Message object (via to_yaml and from_yaml) so that you can pass objects to your Mailer classes. Other similar
34
+ We serialize the Mail::Message object so that you can pass objects to your Mailer classes. Other similar
35
35
  implementations of asynchronous mailing, queue the Mailer name with the mail parameters, building the email parts at send time. This
36
36
  implementation allows our workers to be unaware of any data models or views that are required to build the email. Additionally, no further
37
37
  code changes are required to make your mails asynchronous (well, assuming you already have Resque configured).
@@ -16,21 +16,21 @@ class ResqueDelivery
16
16
 
17
17
  def deliver!(mail)
18
18
  # serialize the mail object for later sending
19
- Resque.enqueue_to(queue, job_class, delivery_method, mail.to_yaml)
19
+ Resque.enqueue_to(queue, job_class, delivery_method, mail.encoded)
20
20
  end
21
21
 
22
22
  class SendMail
23
23
  @queue = :medium
24
24
 
25
25
  class << self
26
- def perform(delivery_method, mail_yaml)
27
- real_delivery_method(delivery_method).deliver!(build_message(mail_yaml))
26
+ def perform(delivery_method, mail_text)
27
+ real_delivery_method(delivery_method).deliver!(build_message(mail_text))
28
28
  end
29
29
  protected
30
30
 
31
31
  # deserialize the mail object
32
- def build_message(mail_yaml)
33
- Mail::Message.from_yaml(mail_yaml)
32
+ def build_message(mail_text)
33
+ Mail.new(mail_text)
34
34
  end
35
35
 
36
36
  def real_delivery_method(delivery_method)
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  gem.name = "resque_delivery"
17
17
  gem.require_paths = ['lib']
18
- gem.version = "0.0.1"
18
+ gem.version = "0.0.2"
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_delivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -51,6 +51,7 @@ extensions: []
51
51
  extra_rdoc_files: []
52
52
  files:
53
53
  - .gitignore
54
+ - Gemfile
54
55
  - README.md
55
56
  - lib/resque_delivery.rb
56
57
  - resque_delivery.gemspec