actionmailer 1.0.1 → 1.1.1
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 +34 -0
- data/lib/action_mailer.rb +2 -4
- data/lib/action_mailer/adv_attr_accessor.rb +0 -29
- data/lib/action_mailer/base.rb +141 -44
- data/lib/action_mailer/helpers.rb +3 -3
- data/lib/action_mailer/mail_helper.rb +5 -3
- data/lib/action_mailer/part.rb +35 -3
- data/lib/action_mailer/part_container.rb +18 -1
- data/lib/action_mailer/quoting.rb +8 -48
- data/lib/action_mailer/vendor/text/format.rb +33 -14
- data/lib/action_mailer/vendor/tmail/address.rb +22 -3
- data/lib/action_mailer/vendor/tmail/attachments.rb +3 -1
- data/lib/action_mailer/vendor/tmail/base64.rb +22 -3
- data/lib/action_mailer/vendor/tmail/config.rb +22 -3
- data/lib/action_mailer/vendor/tmail/encode.rb +22 -3
- data/lib/action_mailer/vendor/tmail/facade.rb +22 -3
- data/lib/action_mailer/vendor/tmail/header.rb +27 -6
- data/lib/action_mailer/vendor/tmail/info.rb +22 -3
- data/lib/action_mailer/vendor/tmail/mail.rb +22 -3
- data/lib/action_mailer/vendor/tmail/mailbox.rb +22 -3
- data/lib/action_mailer/vendor/tmail/net.rb +22 -3
- data/lib/action_mailer/vendor/tmail/obsolete.rb +22 -3
- data/lib/action_mailer/vendor/tmail/parser.rb +22 -3
- data/lib/action_mailer/vendor/tmail/port.rb +22 -3
- data/lib/action_mailer/vendor/tmail/quoting.rb +6 -5
- data/lib/action_mailer/vendor/tmail/scanner.rb +22 -3
- data/lib/action_mailer/vendor/tmail/scanner_r.rb +22 -3
- data/lib/action_mailer/vendor/tmail/stringio.rb +22 -5
- data/lib/action_mailer/vendor/tmail/utils.rb +22 -3
- data/lib/action_mailer/version.rb +9 -0
- data/rakefile +5 -4
- data/test/fixtures/raw_email12 +32 -0
- data/test/mail_render_test.rb +48 -0
- data/test/mail_service_test.rb +62 -5
- data/test/quoting_test.rb +48 -0
- data/test/tmail_test.rb +17 -0
- metadata +8 -3
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# mailbox.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
require 'tmail/port'
|
12
31
|
require 'socket'
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# net.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
require 'nkf'
|
12
31
|
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# obsolete.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
module TMail
|
12
31
|
|
@@ -490,12 +490,31 @@ end # end of racc/parser.rb
|
|
490
490
|
#
|
491
491
|
# parser.rb
|
492
492
|
#
|
493
|
+
#--
|
493
494
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
494
495
|
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
496
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
497
|
+
# a copy of this software and associated documentation files (the
|
498
|
+
# "Software"), to deal in the Software without restriction, including
|
499
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
500
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
501
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
502
|
+
# the following conditions:
|
498
503
|
#
|
504
|
+
# The above copyright notice and this permission notice shall be
|
505
|
+
# included in all copies or substantial portions of the Software.
|
506
|
+
#
|
507
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
508
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
509
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
510
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
511
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
512
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
513
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
514
|
+
#
|
515
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
516
|
+
# with permission of Minero Aoki.
|
517
|
+
#++
|
499
518
|
|
500
519
|
require 'tmail/scanner'
|
501
520
|
require 'tmail/utils'
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# port.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
require 'tmail/stringio'
|
12
31
|
|
@@ -9,7 +9,7 @@ module TMail
|
|
9
9
|
case (content_transfer_encoding || "7bit").downcase
|
10
10
|
when "quoted-printable"
|
11
11
|
Unquoter.unquote_quoted_printable_and_convert_to(quoted_body,
|
12
|
-
to_charset, from_charset)
|
12
|
+
to_charset, from_charset, true)
|
13
13
|
when "base64"
|
14
14
|
Unquoter.unquote_base64_and_convert_to(quoted_body, to_charset,
|
15
15
|
from_charset)
|
@@ -47,7 +47,7 @@ module TMail
|
|
47
47
|
|
48
48
|
class Unquoter
|
49
49
|
class << self
|
50
|
-
def unquote_and_convert_to(text, to_charset, from_charset = "iso-8859-1")
|
50
|
+
def unquote_and_convert_to(text, to_charset, from_charset = "iso-8859-1", preserve_underscores=false)
|
51
51
|
return "" if text.nil?
|
52
52
|
if text =~ /^=\?(.*?)\?(.)\?(.*)\?=$/
|
53
53
|
from_charset = $1
|
@@ -55,7 +55,7 @@ module TMail
|
|
55
55
|
text = $3
|
56
56
|
case quoting_method.upcase
|
57
57
|
when "Q" then
|
58
|
-
unquote_quoted_printable_and_convert_to(text, to_charset, from_charset)
|
58
|
+
unquote_quoted_printable_and_convert_to(text, to_charset, from_charset, preserve_underscores)
|
59
59
|
when "B" then
|
60
60
|
unquote_base64_and_convert_to(text, to_charset, from_charset)
|
61
61
|
else
|
@@ -66,8 +66,9 @@ module TMail
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
def unquote_quoted_printable_and_convert_to(text, to, from)
|
70
|
-
|
69
|
+
def unquote_quoted_printable_and_convert_to(text, to, from, preserve_underscores=false)
|
70
|
+
text = text.gsub(/_/, " ") unless preserve_underscores
|
71
|
+
convert_to(text.unpack("M*").first, to, from)
|
71
72
|
end
|
72
73
|
|
73
74
|
def unquote_base64_and_convert_to(text, to, from)
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# scanner.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
require 'tmail/utils'
|
12
31
|
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# scanner_r.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
require 'tmail/config'
|
12
31
|
|
@@ -1,14 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# stringio.rb
|
3
3
|
#
|
4
|
-
|
4
|
+
#--
|
5
|
+
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
10
|
-
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
11
17
|
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
12
29
|
|
13
30
|
class StringInput#:nodoc:
|
14
31
|
|
@@ -1,12 +1,31 @@
|
|
1
1
|
#
|
2
2
|
# utils.rb
|
3
3
|
#
|
4
|
+
#--
|
4
5
|
# Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
|
5
6
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
9
14
|
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
#
|
26
|
+
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
|
27
|
+
# with permission of Minero Aoki.
|
28
|
+
#++
|
10
29
|
|
11
30
|
module TMail
|
12
31
|
|
data/rakefile
CHANGED
@@ -5,10 +5,11 @@ require 'rake/rdoctask'
|
|
5
5
|
require 'rake/packagetask'
|
6
6
|
require 'rake/gempackagetask'
|
7
7
|
require 'rake/contrib/rubyforgepublisher'
|
8
|
+
require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
|
8
9
|
|
9
10
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
10
11
|
PKG_NAME = 'actionmailer'
|
11
|
-
PKG_VERSION =
|
12
|
+
PKG_VERSION = ActionMailer::Version::STRING + PKG_BUILD
|
12
13
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
13
14
|
|
14
15
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
@@ -31,7 +32,7 @@ Rake::TestTask.new { |t|
|
|
31
32
|
Rake::RDocTask.new { |rdoc|
|
32
33
|
rdoc.rdoc_dir = 'doc'
|
33
34
|
rdoc.title = "Action Mailer -- Easy email delivery and testing"
|
34
|
-
rdoc.options << '--line-numbers --inline-source --main README'
|
35
|
+
rdoc.options << '--line-numbers --inline-source --main README --accessor adv_attr_accessor=M'
|
35
36
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
36
37
|
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
37
38
|
rdoc.rdoc_files.include('lib/action_mailer.rb')
|
@@ -52,7 +53,7 @@ spec = Gem::Specification.new do |s|
|
|
52
53
|
s.rubyforge_project = "actionmailer"
|
53
54
|
s.homepage = "http://www.rubyonrails.org"
|
54
55
|
|
55
|
-
s.add_dependency('actionpack', '= 1.
|
56
|
+
s.add_dependency('actionpack', '= 1.10.1' + PKG_BUILD)
|
56
57
|
|
57
58
|
s.has_rdoc = true
|
58
59
|
s.requirements << 'none'
|
@@ -194,4 +195,4 @@ task :release => [:package] do
|
|
194
195
|
first_file = false
|
195
196
|
end
|
196
197
|
end
|
197
|
-
end
|
198
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Mime-Version: 1.0 (Apple Message framework v730)
|
2
|
+
Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151
|
3
|
+
Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com>
|
4
|
+
From: foo@example.com
|
5
|
+
Subject: testing
|
6
|
+
Date: Mon, 6 Jun 2005 22:21:22 +0200
|
7
|
+
To: blah@example.com
|
8
|
+
|
9
|
+
|
10
|
+
--Apple-Mail-13-196941151
|
11
|
+
Content-Transfer-Encoding: quoted-printable
|
12
|
+
Content-Type: text/plain;
|
13
|
+
charset=ISO-8859-1;
|
14
|
+
delsp=yes;
|
15
|
+
format=flowed
|
16
|
+
|
17
|
+
This is the first part.
|
18
|
+
|
19
|
+
--Apple-Mail-13-196941151
|
20
|
+
Content-Type: image/jpeg
|
21
|
+
Content-Transfer-Encoding: base64
|
22
|
+
Content-Location: Photo25.jpg
|
23
|
+
Content-ID: <qbFGyPQAS8>
|
24
|
+
Content-Disposition: inline
|
25
|
+
|
26
|
+
jamisSqGSIb3DQEHAqCAMIjamisxCzAJBgUrDgMCGgUAMIAGCSqGSjamisEHAQAAoIIFSjCCBUYw
|
27
|
+
ggQujamisQICBD++ukQwDQYJKojamisNAQEFBQAwMTELMAkGA1UEBhMCRjamisAKBgNVBAoTA1RE
|
28
|
+
QzEUMBIGjamisxMLVERDIE9DRVMgQ0jamisNMDQwMjI5MTE1OTAxWhcNMDYwMjamisIyOTAxWjCB
|
29
|
+
gDELMAkGA1UEjamisEsxKTAnBgNVBAoTIEjamisuIG9yZ2FuaXNhdG9yaXNrIHRpbjamisRuaW5=
|
30
|
+
|
31
|
+
--Apple-Mail-13-196941151--
|
32
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + "/../lib/")
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'action_mailer'
|
5
|
+
|
6
|
+
class RenderMailer < ActionMailer::Base
|
7
|
+
def inline_template(recipient)
|
8
|
+
recipients recipient
|
9
|
+
subject "using helpers"
|
10
|
+
from "tester@example.com"
|
11
|
+
body render(:inline => "Hello, <%= @world %>", :body => { :world => "Earth" })
|
12
|
+
end
|
13
|
+
|
14
|
+
def file_template(recipient)
|
15
|
+
recipients recipient
|
16
|
+
subject "using helpers"
|
17
|
+
from "tester@example.com"
|
18
|
+
body render(:file => "signed_up", :body => { :recipient => recipient })
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize_defaults(method_name)
|
22
|
+
super
|
23
|
+
mailer_name "test_mailer"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
RenderMailer.template_root = File.dirname(__FILE__) + "/fixtures"
|
28
|
+
|
29
|
+
class RenderHelperTest < Test::Unit::TestCase
|
30
|
+
def setup
|
31
|
+
ActionMailer::Base.delivery_method = :test
|
32
|
+
ActionMailer::Base.perform_deliveries = true
|
33
|
+
ActionMailer::Base.deliveries = []
|
34
|
+
|
35
|
+
@recipient = 'test@localhost'
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_inline_template
|
39
|
+
mail = RenderMailer.create_inline_template(@recipient)
|
40
|
+
assert_equal "Hello, Earth", mail.body.strip
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_file_template
|
44
|
+
mail = RenderMailer.create_file_template(@recipient)
|
45
|
+
assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|