actionmailer 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionmailer might be problematic. Click here for more details.
- data/CHANGELOG +2 -5
- data/MIT-LICENSE +1 -1
- data/README +14 -10
- data/Rakefile +3 -4
- data/lib/action_mailer.rb +1 -1
- data/lib/action_mailer/adv_attr_accessor.rb +1 -1
- data/lib/action_mailer/base.rb +140 -100
- data/lib/action_mailer/helpers.rb +7 -7
- data/lib/action_mailer/part.rb +2 -2
- data/lib/action_mailer/quoting.rb +3 -1
- data/lib/action_mailer/test_case.rb +14 -22
- data/lib/action_mailer/vendor.rb +2 -2
- data/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb +0 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail.rb +1 -0
- data/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +426 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/attachments.rb +2 -3
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/base64.rb +4 -10
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/compat.rb +8 -6
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/config.rb +2 -6
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/core_extensions.rb +14 -18
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/encode.rb +77 -19
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/header.rb +7 -10
- data/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +9 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/interface.rb +20 -13
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/loader.rb +2 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/mail.rb +97 -26
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/mailbox.rb +70 -10
- data/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +6 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/mbox.rb +2 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/net.rb +16 -15
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/obsolete.rb +7 -12
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/parser.rb +1 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/port.rb +0 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/quoting.rb +0 -0
- data/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +58 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/scanner.rb +3 -1
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/scanner_r.rb +15 -15
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/stringio.rb +1 -0
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/utils.rb +89 -32
- data/lib/action_mailer/vendor/{tmail-1.2.1 → tmail-1.2.3}/tmail/version.rb +4 -3
- data/lib/action_mailer/version.rb +2 -2
- data/test/delivery_method_test.rb +1 -1
- data/test/mail_helper_test.rb +1 -1
- data/test/mail_render_test.rb +1 -1
- data/test/mail_service_test.rb +48 -9
- data/test/quoting_test.rb +19 -32
- data/test/test_helper_test.rb +3 -9
- data/test/tmail_test.rb +1 -1
- data/test/url_test.rb +2 -2
- metadata +33 -53
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/Makefile +0 -19
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/address.rb +0 -245
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/facade.rb +0 -552
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/info.rb +0 -35
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/parser.y +0 -381
- data/lib/action_mailer/vendor/tmail-1.2.1/tmail/tmail.rb +0 -1
- data/test/fixtures/first_mailer/share.rhtml +0 -0
- data/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
- data/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
- data/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
- data/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
- data/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
- data/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
- data/test/fixtures/raw_base64_decoded_string +0 -0
- data/test/fixtures/raw_base64_encoded_string +0 -1
- data/test/fixtures/second_mailer/share.rhtml +0 -0
- data/test/fixtures/templates/signed_up.rhtml +0 -0
- data/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
- data/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
- data/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
- data/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
- data/test/fixtures/test_mailer/signed_up.rhtml +0 -0
- data/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
data/test/mail_render_test.rb
CHANGED
data/test/mail_service_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'abstract_unit'
|
2
3
|
|
3
4
|
class FunkyPathMailer < ActionMailer::Base
|
4
5
|
self.template_root = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
|
@@ -39,6 +40,15 @@ class TestMailer < ActionMailer::Base
|
|
39
40
|
body "Nothing to see here."
|
40
41
|
end
|
41
42
|
|
43
|
+
def different_reply_to(recipient)
|
44
|
+
recipients recipient
|
45
|
+
subject "testing reply_to"
|
46
|
+
from "system@loudthinking.com"
|
47
|
+
sent_on Time.local(2008, 5, 23)
|
48
|
+
reply_to "atraver@gmail.com"
|
49
|
+
body "Nothing to see here."
|
50
|
+
end
|
51
|
+
|
42
52
|
def iso_charset(recipient)
|
43
53
|
@recipients = recipient
|
44
54
|
@subject = "testing isø charsets"
|
@@ -444,6 +454,31 @@ class ActionMailerTest < Test::Unit::TestCase
|
|
444
454
|
assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
|
445
455
|
end
|
446
456
|
|
457
|
+
def test_reply_to
|
458
|
+
expected = new_mail
|
459
|
+
|
460
|
+
expected.to = @recipient
|
461
|
+
expected.subject = "testing reply_to"
|
462
|
+
expected.body = "Nothing to see here."
|
463
|
+
expected.from = "system@loudthinking.com"
|
464
|
+
expected.reply_to = "atraver@gmail.com"
|
465
|
+
expected.date = Time.local 2008, 5, 23
|
466
|
+
|
467
|
+
created = nil
|
468
|
+
assert_nothing_raised do
|
469
|
+
created = TestMailer.create_different_reply_to @recipient
|
470
|
+
end
|
471
|
+
assert_not_nil created
|
472
|
+
assert_equal expected.encoded, created.encoded
|
473
|
+
|
474
|
+
assert_nothing_raised do
|
475
|
+
TestMailer.deliver_different_reply_to @recipient
|
476
|
+
end
|
477
|
+
|
478
|
+
assert_not_nil ActionMailer::Base.deliveries.first
|
479
|
+
assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
|
480
|
+
end
|
481
|
+
|
447
482
|
def test_iso_charset
|
448
483
|
expected = new_mail( "iso-8859-1" )
|
449
484
|
expected.to = @recipient
|
@@ -767,23 +802,23 @@ EOF
|
|
767
802
|
|
768
803
|
def test_implicitly_multipart_messages
|
769
804
|
mail = TestMailer.create_implicitly_multipart_example(@recipient)
|
770
|
-
assert_equal
|
805
|
+
assert_equal 3, mail.parts.length
|
771
806
|
assert_equal "1.0", mail.mime_version
|
772
807
|
assert_equal "multipart/alternative", mail.content_type
|
773
808
|
assert_equal "text/yaml", mail.parts[0].content_type
|
774
809
|
assert_equal "utf-8", mail.parts[0].sub_header("content-type", "charset")
|
775
|
-
assert_equal "text/plain", mail.parts[
|
810
|
+
assert_equal "text/plain", mail.parts[1].content_type
|
811
|
+
assert_equal "utf-8", mail.parts[1].sub_header("content-type", "charset")
|
812
|
+
assert_equal "text/html", mail.parts[2].content_type
|
776
813
|
assert_equal "utf-8", mail.parts[2].sub_header("content-type", "charset")
|
777
|
-
assert_equal "text/html", mail.parts[4].content_type
|
778
|
-
assert_equal "utf-8", mail.parts[4].sub_header("content-type", "charset")
|
779
814
|
end
|
780
815
|
|
781
816
|
def test_implicitly_multipart_messages_with_custom_order
|
782
817
|
mail = TestMailer.create_implicitly_multipart_example(@recipient, nil, ["text/yaml", "text/plain"])
|
783
|
-
assert_equal
|
818
|
+
assert_equal 3, mail.parts.length
|
784
819
|
assert_equal "text/html", mail.parts[0].content_type
|
785
|
-
assert_equal "text/plain", mail.parts[
|
786
|
-
assert_equal "text/yaml", mail.parts[
|
820
|
+
assert_equal "text/plain", mail.parts[1].content_type
|
821
|
+
assert_equal "text/yaml", mail.parts[2].content_type
|
787
822
|
end
|
788
823
|
|
789
824
|
def test_implicitly_multipart_messages_with_charset
|
@@ -839,7 +874,11 @@ EOF
|
|
839
874
|
fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email8")
|
840
875
|
mail = TMail::Mail.parse(fixture)
|
841
876
|
attachment = mail.attachments.last
|
842
|
-
|
877
|
+
|
878
|
+
expected = "01 Quien Te Dij\212at. Pitbull.mp3"
|
879
|
+
expected.force_encoding(Encoding::ASCII_8BIT) if expected.respond_to?(:force_encoding)
|
880
|
+
|
881
|
+
assert_equal expected, attachment.original_filename
|
843
882
|
end
|
844
883
|
|
845
884
|
def test_wrong_mail_header
|
data/test/quoting_test.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'abstract_unit'
|
2
3
|
require 'tmail'
|
3
4
|
require 'tempfile'
|
4
5
|
|
5
6
|
class QuotingTest < Test::Unit::TestCase
|
6
|
-
|
7
7
|
# Move some tests from TMAIL here
|
8
8
|
def test_unquote_quoted_printable
|
9
|
-
a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?="
|
9
|
+
a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?="
|
10
10
|
b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
|
11
11
|
assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b
|
12
12
|
end
|
@@ -18,31 +18,34 @@ class QuotingTest < Test::Unit::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_unquote_without_charset
|
21
|
-
a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber"
|
21
|
+
a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber"
|
22
22
|
b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
|
23
23
|
assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b
|
24
|
-
end
|
25
|
-
|
24
|
+
end
|
25
|
+
|
26
26
|
def test_unqoute_multiple
|
27
|
-
a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?="
|
27
|
+
a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?="
|
28
28
|
b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
|
29
29
|
assert_equal "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\"", b
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def test_unqoute_in_the_middle
|
33
|
-
a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?="
|
33
|
+
a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?="
|
34
34
|
b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
|
35
35
|
assert_equal "Re: Photos Brosch\303\274re Rand", b
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def test_unqoute_iso
|
39
|
-
a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?="
|
39
|
+
a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?="
|
40
40
|
b = TMail::Unquoter.unquote_and_convert_to(a, 'iso-8859-1')
|
41
|
-
|
41
|
+
expected = "Brosch\374re Rand"
|
42
|
+
expected.force_encoding 'iso-8859-1' if expected.respond_to?(:force_encoding)
|
43
|
+
assert_equal expected, b
|
42
44
|
end
|
43
|
-
|
45
|
+
|
44
46
|
def test_quote_multibyte_chars
|
45
47
|
original = "\303\246 \303\270 and \303\245"
|
48
|
+
original.force_encoding('ASCII-8BIT') if original.respond_to?(:force_encoding)
|
46
49
|
|
47
50
|
result = execute_in_sandbox(<<-CODE)
|
48
51
|
$:.unshift(File.dirname(__FILE__) + "/../lib/")
|
@@ -56,8 +59,8 @@ class QuotingTest < Test::Unit::TestCase
|
|
56
59
|
unquoted = TMail::Unquoter.unquote_and_convert_to(result, nil)
|
57
60
|
assert_equal unquoted, original
|
58
61
|
end
|
59
|
-
|
60
|
-
|
62
|
+
|
63
|
+
|
61
64
|
# test an email that has been created using \r\n newlines, instead of
|
62
65
|
# \n newlines.
|
63
66
|
def test_email_quoted_with_0d0a
|
@@ -69,19 +72,8 @@ class QuotingTest < Test::Unit::TestCase
|
|
69
72
|
mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject"))
|
70
73
|
assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
|
71
74
|
end
|
72
|
-
|
73
|
-
def test_decode
|
74
|
-
encoded, decoded = expected_base64_strings
|
75
|
-
assert_equal decoded, TMail::Base64.decode(encoded)
|
76
|
-
end
|
77
|
-
|
78
|
-
def test_encode
|
79
|
-
encoded, decoded = expected_base64_strings
|
80
|
-
assert_equal encoded.length, TMail::Base64.encode(decoded).length
|
81
|
-
end
|
82
|
-
|
75
|
+
|
83
76
|
private
|
84
|
-
|
85
77
|
# This whole thing *could* be much simpler, but I don't think Tempfile,
|
86
78
|
# popen and others exist on all platforms (like Windows).
|
87
79
|
def execute_in_sandbox(code)
|
@@ -103,9 +95,4 @@ class QuotingTest < Test::Unit::TestCase
|
|
103
95
|
File.delete(test_name) rescue nil
|
104
96
|
File.delete(res_name) rescue nil
|
105
97
|
end
|
106
|
-
|
107
|
-
def expected_base64_strings
|
108
|
-
[ File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_encoded_string"), File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_decoded_string") ]
|
109
|
-
end
|
110
98
|
end
|
111
|
-
|
data/test/test_helper_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'abstract_unit'
|
2
2
|
|
3
3
|
class TestHelperMailer < ActionMailer::Base
|
4
4
|
def test
|
@@ -9,7 +9,6 @@ class TestHelperMailer < ActionMailer::Base
|
|
9
9
|
end
|
10
10
|
|
11
11
|
class TestHelperMailerTest < ActionMailer::TestCase
|
12
|
-
|
13
12
|
def test_setup_sets_right_action_mailer_options
|
14
13
|
assert_equal :test, ActionMailer::Base.delivery_method
|
15
14
|
assert ActionMailer::Base.perform_deliveries
|
@@ -117,19 +116,14 @@ class TestHelperMailerTest < ActionMailer::TestCase
|
|
117
116
|
end
|
118
117
|
|
119
118
|
class AnotherTestHelperMailerTest < ActionMailer::TestCase
|
120
|
-
|
121
119
|
tests TestHelperMailer
|
122
120
|
|
123
121
|
def setup
|
124
|
-
# Should not override ActionMailer setup methods
|
125
122
|
@test_var = "a value"
|
126
123
|
end
|
127
124
|
|
128
|
-
def
|
125
|
+
def test_setup_shouldnt_conflict_with_mailer_setup
|
129
126
|
assert @expected.is_a?(TMail::Mail)
|
130
|
-
|
131
|
-
|
132
|
-
def test_should_run_overridden_setup_method
|
133
|
-
assert @test_var
|
127
|
+
assert_equal 'a value', @test_var
|
134
128
|
end
|
135
129
|
end
|
data/test/tmail_test.rb
CHANGED
data/test/url_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'abstract_unit'
|
2
2
|
|
3
3
|
class TestMailer < ActionMailer::Base
|
4
4
|
|
@@ -73,4 +73,4 @@ class ActionMailerUrlTest < Test::Unit::TestCase
|
|
73
73
|
assert_not_nil ActionMailer::Base.deliveries.first
|
74
74
|
assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
|
75
75
|
end
|
76
|
-
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,18 +9,17 @@ autorequire: action_mailer
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|
17
|
-
type: :runtime
|
18
17
|
version_requirement:
|
19
18
|
version_requirements: !ruby/object:Gem::Requirement
|
20
19
|
requirements:
|
21
20
|
- - "="
|
22
21
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.0
|
22
|
+
version: 2.1.0
|
24
23
|
version:
|
25
24
|
description: Makes it trivial to test and deliver emails sent from a single service layer.
|
26
25
|
email: david@loudthinking.com
|
@@ -51,37 +50,35 @@ files:
|
|
51
50
|
- lib/action_mailer/vendor/text-format-0.6.3
|
52
51
|
- lib/action_mailer/vendor/text-format-0.6.3/text
|
53
52
|
- lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
|
54
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
55
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
56
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
57
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
58
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
59
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
60
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
61
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
62
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
63
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
64
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
65
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
66
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
67
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
68
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
69
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
70
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
71
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
72
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
73
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
74
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
75
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
76
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
77
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
78
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
79
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
80
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
81
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
82
|
-
- lib/action_mailer/vendor/tmail-1.2.
|
83
|
-
- lib/action_mailer/vendor/tmail-1.2.1/tmail/version.rb
|
84
|
-
- lib/action_mailer/vendor/tmail-1.2.1/tmail.rb
|
53
|
+
- lib/action_mailer/vendor/tmail-1.2.3
|
54
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail
|
55
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
|
56
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb
|
57
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb
|
58
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb
|
59
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb
|
60
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb
|
61
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb
|
62
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
|
63
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb
|
64
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
|
65
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb
|
66
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
|
67
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb
|
68
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb
|
69
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb
|
70
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb
|
71
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb
|
72
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb
|
73
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb
|
74
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb
|
75
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb
|
76
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb
|
77
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb
|
78
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb
|
79
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb
|
80
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb
|
81
|
+
- lib/action_mailer/vendor/tmail-1.2.3/tmail.rb
|
85
82
|
- lib/action_mailer/vendor.rb
|
86
83
|
- lib/action_mailer/version.rb
|
87
84
|
- lib/action_mailer.rb
|
@@ -91,25 +88,16 @@ files:
|
|
91
88
|
- test/fixtures
|
92
89
|
- test/fixtures/first_mailer
|
93
90
|
- test/fixtures/first_mailer/share.erb
|
94
|
-
- test/fixtures/first_mailer/share.rhtml
|
95
91
|
- test/fixtures/helper_mailer
|
96
92
|
- test/fixtures/helper_mailer/use_example_helper.erb
|
97
|
-
- test/fixtures/helper_mailer/use_example_helper.rhtml
|
98
93
|
- test/fixtures/helper_mailer/use_helper.erb
|
99
|
-
- test/fixtures/helper_mailer/use_helper.rhtml
|
100
94
|
- test/fixtures/helper_mailer/use_helper_method.erb
|
101
|
-
- test/fixtures/helper_mailer/use_helper_method.rhtml
|
102
95
|
- test/fixtures/helper_mailer/use_mail_helper.erb
|
103
|
-
- test/fixtures/helper_mailer/use_mail_helper.rhtml
|
104
96
|
- test/fixtures/helpers
|
105
97
|
- test/fixtures/helpers/example_helper.rb
|
106
98
|
- test/fixtures/path.with.dots
|
107
99
|
- test/fixtures/path.with.dots/funky_path_mailer
|
108
100
|
- test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
|
109
|
-
- test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
|
110
|
-
- test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
|
111
|
-
- test/fixtures/raw_base64_decoded_string
|
112
|
-
- test/fixtures/raw_base64_encoded_string
|
113
101
|
- test/fixtures/raw_email
|
114
102
|
- test/fixtures/raw_email10
|
115
103
|
- test/fixtures/raw_email12
|
@@ -128,30 +116,22 @@ files:
|
|
128
116
|
- test/fixtures/raw_email_with_partially_quoted_subject
|
129
117
|
- test/fixtures/second_mailer
|
130
118
|
- test/fixtures/second_mailer/share.erb
|
131
|
-
- test/fixtures/second_mailer/share.rhtml
|
132
119
|
- test/fixtures/templates
|
133
120
|
- test/fixtures/templates/signed_up.erb
|
134
|
-
- test/fixtures/templates/signed_up.rhtml
|
135
121
|
- test/fixtures/test_mailer
|
136
122
|
- test/fixtures/test_mailer/_subtemplate.text.plain.erb
|
137
123
|
- test/fixtures/test_mailer/custom_templating_extension.text.html.haml
|
138
124
|
- test/fixtures/test_mailer/custom_templating_extension.text.plain.haml
|
139
125
|
- test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
|
140
|
-
- test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
|
141
126
|
- test/fixtures/test_mailer/implicitly_multipart_example.rhtml.bak
|
142
127
|
- test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
|
143
|
-
- test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
|
144
128
|
- test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
|
145
|
-
- test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
|
146
129
|
- test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
|
147
|
-
- test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
|
148
130
|
- test/fixtures/test_mailer/included_subtemplate.text.plain.erb
|
149
131
|
- test/fixtures/test_mailer/rxml_template.builder
|
150
132
|
- test/fixtures/test_mailer/rxml_template.rxml
|
151
133
|
- test/fixtures/test_mailer/signed_up.erb
|
152
|
-
- test/fixtures/test_mailer/signed_up.rhtml
|
153
134
|
- test/fixtures/test_mailer/signed_up_with_url.erb
|
154
|
-
- test/fixtures/test_mailer/signed_up_with_url.rhtml
|
155
135
|
- test/mail_helper_test.rb
|
156
136
|
- test/mail_render_test.rb
|
157
137
|
- test/mail_service_test.rb
|
@@ -181,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
161
|
requirements:
|
182
162
|
- none
|
183
163
|
rubyforge_project: actionmailer
|
184
|
-
rubygems_version: 1.
|
164
|
+
rubygems_version: 1.0.1
|
185
165
|
signing_key:
|
186
166
|
specification_version: 2
|
187
167
|
summary: Service layer for easy email delivery and testing.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# lib/tmail/Makefile
|
3
|
-
#
|
4
|
-
|
5
|
-
debug:
|
6
|
-
rm -f parser.rb
|
7
|
-
make parser.rb DEBUG=true
|
8
|
-
|
9
|
-
parser.rb: parser.y
|
10
|
-
if [ "$(DEBUG)" = true ]; then \
|
11
|
-
racc -v -g -o$@ parser.y ;\
|
12
|
-
else \
|
13
|
-
racc -E -o$@ parser.y ;\
|
14
|
-
fi
|
15
|
-
|
16
|
-
clean:
|
17
|
-
rm -f parser.rb parser.output
|
18
|
-
|
19
|
-
distclean: clean
|
@@ -1,245 +0,0 @@
|
|
1
|
-
=begin rdoc
|
2
|
-
|
3
|
-
= Address handling class
|
4
|
-
|
5
|
-
=end
|
6
|
-
#
|
7
|
-
#--
|
8
|
-
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
9
|
-
#
|
10
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
11
|
-
# a copy of this software and associated documentation files (the
|
12
|
-
# "Software"), to deal in the Software without restriction, including
|
13
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
14
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
15
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
16
|
-
# the following conditions:
|
17
|
-
#
|
18
|
-
# The above copyright notice and this permission notice shall be
|
19
|
-
# included in all copies or substantial portions of the Software.
|
20
|
-
#
|
21
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
22
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
23
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
24
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
25
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
26
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
27
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
28
|
-
#
|
29
|
-
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
30
|
-
# with permission of Minero Aoki.
|
31
|
-
#++
|
32
|
-
|
33
|
-
require 'tmail/encode'
|
34
|
-
require 'tmail/parser'
|
35
|
-
|
36
|
-
|
37
|
-
module TMail
|
38
|
-
|
39
|
-
class Address
|
40
|
-
|
41
|
-
include TextUtils
|
42
|
-
|
43
|
-
def Address.parse( str )
|
44
|
-
Parser.parse :ADDRESS, str
|
45
|
-
end
|
46
|
-
|
47
|
-
def address_group?
|
48
|
-
false
|
49
|
-
end
|
50
|
-
|
51
|
-
def initialize( local, domain )
|
52
|
-
if domain
|
53
|
-
domain.each do |s|
|
54
|
-
raise SyntaxError, 'empty word in domain' if s.empty?
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
@local = local
|
59
|
-
@domain = domain
|
60
|
-
@name = nil
|
61
|
-
@routes = []
|
62
|
-
end
|
63
|
-
|
64
|
-
attr_reader :name
|
65
|
-
|
66
|
-
def name=( str )
|
67
|
-
@name = str
|
68
|
-
@name = nil if str and str.empty?
|
69
|
-
end
|
70
|
-
|
71
|
-
alias phrase name
|
72
|
-
alias phrase= name=
|
73
|
-
|
74
|
-
attr_reader :routes
|
75
|
-
|
76
|
-
def inspect
|
77
|
-
"#<#{self.class} #{address()}>"
|
78
|
-
end
|
79
|
-
|
80
|
-
def local
|
81
|
-
return nil unless @local
|
82
|
-
return '""' if @local.size == 1 and @local[0].empty?
|
83
|
-
@local.map {|i| quote_atom(i) }.join('.')
|
84
|
-
end
|
85
|
-
|
86
|
-
def domain
|
87
|
-
return nil unless @domain
|
88
|
-
join_domain(@domain)
|
89
|
-
end
|
90
|
-
|
91
|
-
def spec
|
92
|
-
s = self.local
|
93
|
-
d = self.domain
|
94
|
-
if s and d
|
95
|
-
s + '@' + d
|
96
|
-
else
|
97
|
-
s
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
alias address spec
|
102
|
-
|
103
|
-
def ==( other )
|
104
|
-
other.respond_to? :spec and self.spec == other.spec
|
105
|
-
end
|
106
|
-
|
107
|
-
alias eql? ==
|
108
|
-
|
109
|
-
def hash
|
110
|
-
@local.hash ^ @domain.hash
|
111
|
-
end
|
112
|
-
|
113
|
-
def dup
|
114
|
-
obj = self.class.new(@local.dup, @domain.dup)
|
115
|
-
obj.name = @name.dup if @name
|
116
|
-
obj.routes.replace @routes
|
117
|
-
obj
|
118
|
-
end
|
119
|
-
|
120
|
-
include StrategyInterface
|
121
|
-
|
122
|
-
def accept( strategy, dummy1 = nil, dummy2 = nil )
|
123
|
-
unless @local
|
124
|
-
strategy.meta '<>' # empty return-path
|
125
|
-
return
|
126
|
-
end
|
127
|
-
|
128
|
-
spec_p = (not @name and @routes.empty?)
|
129
|
-
if @name
|
130
|
-
strategy.phrase @name
|
131
|
-
strategy.space
|
132
|
-
end
|
133
|
-
tmp = spec_p ? '' : '<'
|
134
|
-
unless @routes.empty?
|
135
|
-
tmp << @routes.map {|i| '@' + i }.join(',') << ':'
|
136
|
-
end
|
137
|
-
tmp << self.spec
|
138
|
-
tmp << '>' unless spec_p
|
139
|
-
strategy.meta tmp
|
140
|
-
strategy.lwsp ''
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
|
145
|
-
|
146
|
-
class AddressGroup
|
147
|
-
|
148
|
-
include Enumerable
|
149
|
-
|
150
|
-
def address_group?
|
151
|
-
true
|
152
|
-
end
|
153
|
-
|
154
|
-
def initialize( name, addrs )
|
155
|
-
@name = name
|
156
|
-
@addresses = addrs
|
157
|
-
end
|
158
|
-
|
159
|
-
attr_reader :name
|
160
|
-
|
161
|
-
def ==( other )
|
162
|
-
other.respond_to? :to_a and @addresses == other.to_a
|
163
|
-
end
|
164
|
-
|
165
|
-
alias eql? ==
|
166
|
-
|
167
|
-
def hash
|
168
|
-
map {|i| i.hash }.hash
|
169
|
-
end
|
170
|
-
|
171
|
-
def []( idx )
|
172
|
-
@addresses[idx]
|
173
|
-
end
|
174
|
-
|
175
|
-
def size
|
176
|
-
@addresses.size
|
177
|
-
end
|
178
|
-
|
179
|
-
def empty?
|
180
|
-
@addresses.empty?
|
181
|
-
end
|
182
|
-
|
183
|
-
def each( &block )
|
184
|
-
@addresses.each(&block)
|
185
|
-
end
|
186
|
-
|
187
|
-
def to_a
|
188
|
-
@addresses.dup
|
189
|
-
end
|
190
|
-
|
191
|
-
alias to_ary to_a
|
192
|
-
|
193
|
-
def include?( a )
|
194
|
-
@addresses.include? a
|
195
|
-
end
|
196
|
-
|
197
|
-
def flatten
|
198
|
-
set = []
|
199
|
-
@addresses.each do |a|
|
200
|
-
if a.respond_to? :flatten
|
201
|
-
set.concat a.flatten
|
202
|
-
else
|
203
|
-
set.push a
|
204
|
-
end
|
205
|
-
end
|
206
|
-
set
|
207
|
-
end
|
208
|
-
|
209
|
-
def each_address( &block )
|
210
|
-
flatten.each(&block)
|
211
|
-
end
|
212
|
-
|
213
|
-
def add( a )
|
214
|
-
@addresses.push a
|
215
|
-
end
|
216
|
-
|
217
|
-
alias push add
|
218
|
-
|
219
|
-
def delete( a )
|
220
|
-
@addresses.delete a
|
221
|
-
end
|
222
|
-
|
223
|
-
include StrategyInterface
|
224
|
-
|
225
|
-
def accept( strategy, dummy1 = nil, dummy2 = nil )
|
226
|
-
strategy.phrase @name
|
227
|
-
strategy.meta ':'
|
228
|
-
strategy.space
|
229
|
-
first = true
|
230
|
-
each do |mbox|
|
231
|
-
if first
|
232
|
-
first = false
|
233
|
-
else
|
234
|
-
strategy.meta ','
|
235
|
-
end
|
236
|
-
strategy.space
|
237
|
-
mbox.accept strategy
|
238
|
-
end
|
239
|
-
strategy.meta ';'
|
240
|
-
strategy.lwsp ''
|
241
|
-
end
|
242
|
-
|
243
|
-
end
|
244
|
-
|
245
|
-
end # module TMail
|