resque_mailer 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 2.0.3 / 2012-02-17
2
+
3
+ * Added ability to override local queue name (example scenario: using
4
+ two different queues for different mail priority levels)
5
+
1
6
  ### 2.0.2 / 2011-08-20
2
7
 
3
8
  * Fixed deliver vs deliver! issue so mail interceptors will work as
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.0.3
data/lib/resque_mailer.rb CHANGED
@@ -41,7 +41,11 @@ module Resque
41
41
  end
42
42
 
43
43
  def queue
44
- ::Resque::Mailer.default_queue_name
44
+ @queue || ::Resque::Mailer.default_queue_name
45
+ end
46
+
47
+ def queue=(name)
48
+ @queue = name
45
49
  end
46
50
 
47
51
  def resque
@@ -51,6 +55,10 @@ module Resque
51
55
  def excluded_environment?(name)
52
56
  ::Resque::Mailer.excluded_environments && ::Resque::Mailer.excluded_environments.include?(name.to_sym)
53
57
  end
58
+
59
+ def deliver?
60
+ true
61
+ end
54
62
  end
55
63
 
56
64
  class MessageDecoy
@@ -69,7 +77,9 @@ module Resque
69
77
  end
70
78
 
71
79
  def deliver
72
- resque.enqueue(@mailer_class, @method_name, *@args)
80
+ if @mailer_class.deliver?
81
+ resque.enqueue(@mailer_class, @method_name, *@args)
82
+ end
73
83
  end
74
84
 
75
85
  def deliver!
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{resque_mailer}
8
- s.version = "2.0.2"
8
+ s.version = "2.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Nick Plante"]
12
- s.date = %q{2011-08-20}
11
+ s.authors = [%q{Nick Plante}]
12
+ s.date = %q{2012-02-17}
13
13
  s.description = %q{Rails plugin for sending asynchronous email with ActionMailer and Resque}
14
14
  s.email = %q{nap@zerosum.org}
15
15
  s.extra_rdoc_files = [
@@ -33,12 +33,11 @@ Gem::Specification.new do |s|
33
33
  "spec/spec_helper.rb"
34
34
  ]
35
35
  s.homepage = %q{http://github.com/zapnap/resque_mailer}
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.7}
36
+ s.require_paths = [%q{lib}]
37
+ s.rubygems_version = %q{1.8.9}
38
38
  s.summary = %q{Rails plugin for sending asynchronous email with ActionMailer and Resque}
39
39
 
40
40
  if s.respond_to? :specification_version then
41
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
41
  s.specification_version = 3
43
42
 
44
43
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -15,6 +15,10 @@ class Rails3Mailer < ActionMailer::Base
15
15
  end
16
16
  end
17
17
 
18
+ class PriorityMailer < Rails3Mailer
19
+ self.queue = 'priority_mailer'
20
+ end
21
+
18
22
  describe Resque::Mailer do
19
23
  let(:resque) { FakeResque }
20
24
 
@@ -40,6 +44,10 @@ describe Resque::Mailer do
40
44
  Resque::Mailer.default_queue_name = "postal"
41
45
  Rails3Mailer.queue.should == "postal"
42
46
  end
47
+
48
+ it "allows overriding of the local queue name" do
49
+ PriorityMailer.queue.should == "priority_mailer"
50
+ end
43
51
  end
44
52
 
45
53
  describe '#deliver' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_mailer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nick Plante
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-20 00:00:00 -04:00
19
- default_executable:
18
+ date: 2012-02-17 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
25
24
  - - ">="
@@ -30,12 +29,12 @@ dependencies:
30
29
  - 2
31
30
  - 3
32
31
  version: 1.2.3
33
- type: :runtime
32
+ requirement: *id001
34
33
  prerelease: false
35
34
  name: resque
36
- version_requirements: *id001
35
+ type: :runtime
37
36
  - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
40
39
  requirements:
41
40
  - - ">="
@@ -46,12 +45,12 @@ dependencies:
46
45
  - 0
47
46
  - 0
48
47
  version: 3.0.0
49
- type: :runtime
48
+ requirement: *id002
50
49
  prerelease: false
51
50
  name: actionmailer
52
- version_requirements: *id002
51
+ type: :runtime
53
52
  - !ruby/object:Gem::Dependency
54
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
54
  none: false
56
55
  requirements:
57
56
  - - ">="
@@ -62,12 +61,12 @@ dependencies:
62
61
  - 6
63
62
  - 0
64
63
  version: 2.6.0
65
- type: :development
64
+ requirement: *id003
66
65
  prerelease: false
67
66
  name: rspec
68
- version_requirements: *id003
67
+ type: :development
69
68
  - !ruby/object:Gem::Dependency
70
- requirement: &id004 !ruby/object:Gem::Requirement
69
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
70
  none: false
72
71
  requirements:
73
72
  - - ">="
@@ -78,12 +77,12 @@ dependencies:
78
77
  - 6
79
78
  - 0
80
79
  version: 0.6.0
81
- type: :development
80
+ requirement: *id004
82
81
  prerelease: false
83
82
  name: yard
84
- version_requirements: *id004
83
+ type: :development
85
84
  - !ruby/object:Gem::Dependency
86
- requirement: &id005 !ruby/object:Gem::Requirement
85
+ version_requirements: &id005 !ruby/object:Gem::Requirement
87
86
  none: false
88
87
  requirements:
89
88
  - - ~>
@@ -94,12 +93,12 @@ dependencies:
94
93
  - 0
95
94
  - 0
96
95
  version: 1.0.0
97
- type: :development
96
+ requirement: *id005
98
97
  prerelease: false
99
98
  name: bundler
100
- version_requirements: *id005
99
+ type: :development
101
100
  - !ruby/object:Gem::Dependency
102
- requirement: &id006 !ruby/object:Gem::Requirement
101
+ version_requirements: &id006 !ruby/object:Gem::Requirement
103
102
  none: false
104
103
  requirements:
105
104
  - - ~>
@@ -110,12 +109,12 @@ dependencies:
110
109
  - 6
111
110
  - 2
112
111
  version: 1.6.2
113
- type: :development
112
+ requirement: *id006
114
113
  prerelease: false
115
114
  name: jeweler
116
- version_requirements: *id006
115
+ type: :development
117
116
  - !ruby/object:Gem::Dependency
118
- requirement: &id007 !ruby/object:Gem::Requirement
117
+ version_requirements: &id007 !ruby/object:Gem::Requirement
119
118
  none: false
120
119
  requirements:
121
120
  - - ">="
@@ -126,12 +125,12 @@ dependencies:
126
125
  - 6
127
126
  - 0
128
127
  version: 2.6.0
129
- type: :development
128
+ requirement: *id007
130
129
  prerelease: false
131
130
  name: rspec
132
- version_requirements: *id007
131
+ type: :development
133
132
  - !ruby/object:Gem::Dependency
134
- requirement: &id008 !ruby/object:Gem::Requirement
133
+ version_requirements: &id008 !ruby/object:Gem::Requirement
135
134
  none: false
136
135
  requirements:
137
136
  - - ">="
@@ -142,12 +141,12 @@ dependencies:
142
141
  - 2
143
142
  - 3
144
143
  version: 1.2.3
145
- type: :development
144
+ requirement: *id008
146
145
  prerelease: false
147
146
  name: resque
148
- version_requirements: *id008
147
+ type: :development
149
148
  - !ruby/object:Gem::Dependency
150
- requirement: &id009 !ruby/object:Gem::Requirement
149
+ version_requirements: &id009 !ruby/object:Gem::Requirement
151
150
  none: false
152
151
  requirements:
153
152
  - - ">="
@@ -158,10 +157,10 @@ dependencies:
158
157
  - 0
159
158
  - 0
160
159
  version: 3.0.0
161
- type: :development
160
+ requirement: *id009
162
161
  prerelease: false
163
162
  name: actionmailer
164
- version_requirements: *id009
163
+ type: :development
165
164
  description: Rails plugin for sending asynchronous email with ActionMailer and Resque
166
165
  email: nap@zerosum.org
167
166
  executables: []
@@ -186,7 +185,6 @@ files:
186
185
  - spec/resque_mailer_spec.rb
187
186
  - spec/spec.opts
188
187
  - spec/spec_helper.rb
189
- has_rdoc: true
190
188
  homepage: http://github.com/zapnap/resque_mailer
191
189
  licenses: []
192
190
 
@@ -216,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
214
  requirements: []
217
215
 
218
216
  rubyforge_project:
219
- rubygems_version: 1.3.7
217
+ rubygems_version: 1.8.9
220
218
  signing_key:
221
219
  specification_version: 3
222
220
  summary: Rails plugin for sending asynchronous email with ActionMailer and Resque