action_mailer_verp 0.0.4 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/action_mailer_verp.gemspec +1 -1
- data/lib/action_mailer_verp.rb +3 -3
- data/spec/action_mailer_verp_spec.rb +4 -4
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.1
|
data/action_mailer_verp.gemspec
CHANGED
data/lib/action_mailer_verp.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'actionmailer'
|
2
2
|
|
3
3
|
module ActionMailerVerp
|
4
|
-
module
|
4
|
+
module VERPMail
|
5
5
|
class MultipleFromsError < ArgumentError; end
|
6
6
|
class MultipleRecipientsError < ArgumentError; end
|
7
7
|
|
@@ -11,12 +11,12 @@ module ActionMailerVerp
|
|
11
11
|
|
12
12
|
def create_mail_with_verp
|
13
13
|
create_mail_without_verp
|
14
|
-
|
14
|
+
verpify(@mail)
|
15
15
|
@mail
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
19
|
-
def
|
19
|
+
def verpify(mail)
|
20
20
|
if mail.from_addrs.length > 1
|
21
21
|
raise MultipleFromsError, "Multiple from addresses not supported."
|
22
22
|
end
|
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
3
3
|
describe "ActionMailerVerp" do
|
4
4
|
class MyMailer < ActionMailer::Base
|
5
|
-
include ActionMailerVerp::
|
5
|
+
include ActionMailerVerp::VERPMail
|
6
6
|
self.template_root = File.dirname(__FILE__) + "/templates"
|
7
7
|
|
8
8
|
def some_mail(address)
|
@@ -24,7 +24,7 @@ describe "ActionMailerVerp" do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
describe "ActionMailerVerp::
|
27
|
+
describe "ActionMailerVerp::VERPMail" do
|
28
28
|
describe "with one from address" do
|
29
29
|
before do
|
30
30
|
@mail = MyMailer.create_some_mail("james@example.com")
|
@@ -41,7 +41,7 @@ describe "ActionMailerVerp" do
|
|
41
41
|
it "raises an error because that is not supported" do
|
42
42
|
lambda {
|
43
43
|
MyMailer.create_multiple_froms
|
44
|
-
}.should raise_error(ActionMailerVerp::
|
44
|
+
}.should raise_error(ActionMailerVerp::VERPMail::MultipleFromsError)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -49,7 +49,7 @@ describe "ActionMailerVerp" do
|
|
49
49
|
it "raises an error because that is not supported" do
|
50
50
|
lambda {
|
51
51
|
MyMailer.create_multiple_recipients
|
52
|
-
}.should raise_error(ActionMailerVerp::
|
52
|
+
}.should raise_error(ActionMailerVerp::VERPMail::MultipleRecipientsError)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_mailer_verp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Golick
|