actionmailer 2.2.2 → 2.2.3

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 CHANGED
@@ -1,9 +1,10 @@
1
- *2.2.1 [RC2] (November 14th, 2008)*
1
+ *2.2.3 (September 4th, 2009)*
2
2
 
3
- * Turn on STARTTLS if it is available in Net::SMTP (added in Ruby 1.8.7) and the SMTP server supports it (This is required for Gmail's SMTP server) #1336 [Grant Hollingworth]
3
+ Version bump.
4
4
 
5
+ *2.2 (November 21st, 2008)*
5
6
 
6
- *2.2.0 [RC1] (October 24th, 2008)*
7
+ * Turn on STARTTLS if it is available in Net::SMTP (added in Ruby 1.8.7) and the SMTP server supports it (This is required for Gmail's SMTP server) #1336 [Grant Hollingworth]
7
8
 
8
9
  * Add layout functionality to mailers [Pratik]
9
10
 
data/Rakefile CHANGED
@@ -55,7 +55,7 @@ spec = Gem::Specification.new do |s|
55
55
  s.rubyforge_project = "actionmailer"
56
56
  s.homepage = "http://www.rubyonrails.org"
57
57
 
58
- s.add_dependency('actionpack', '= 2.2.2' + PKG_BUILD)
58
+ s.add_dependency('actionpack', '= 2.2.3' + PKG_BUILD)
59
59
 
60
60
  s.has_rdoc = true
61
61
  s.requirements << 'none'
@@ -429,7 +429,7 @@ module ActionMailer #:nodoc:
429
429
  def register_template_extension(extension)
430
430
  ActiveSupport::Deprecation.warn(
431
431
  "ActionMailer::Base.register_template_extension has been deprecated." +
432
- "Use ActionView::Base.register_template_extension instead", caller)
432
+ "Use ActionView::Template.register_template_handler instead", caller)
433
433
  end
434
434
 
435
435
  def template_root
@@ -549,7 +549,12 @@ module ActionMailer #:nodoc:
549
549
  end
550
550
 
551
551
  def render_message(method_name, body)
552
+ if method_name.respond_to?(:content_type)
553
+ @current_template_content_type = method_name.content_type
554
+ end
552
555
  render :file => method_name, :body => body
556
+ ensure
557
+ @current_template_content_type = nil
553
558
  end
554
559
 
555
560
  def render(opts)
@@ -568,7 +573,11 @@ module ActionMailer #:nodoc:
568
573
  end
569
574
 
570
575
  def default_template_format
571
- :html
576
+ if @current_template_content_type
577
+ Mime::Type.lookup(@current_template_content_type).to_sym
578
+ else
579
+ :html
580
+ end
572
581
  end
573
582
 
574
583
  def candidate_for_layout?(options)
@@ -588,7 +597,9 @@ module ActionMailer #:nodoc:
588
597
  end
589
598
 
590
599
  def initialize_template_class(assigns)
591
- ActionView::Base.new(view_paths, assigns, self)
600
+ template = ActionView::Base.new(view_paths, assigns, self)
601
+ template.template_format = default_template_format
602
+ template
592
603
  end
593
604
 
594
605
  def sort_parts(parts, order = [])
@@ -2,7 +2,7 @@ module ActionMailer
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 2
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1 @@
1
+ text/html multipart
@@ -0,0 +1 @@
1
+ text/plain multipart
@@ -0,0 +1 @@
1
+ text/plain layout - <%= yield %>
@@ -20,6 +20,12 @@ class AutoLayoutMailer < ActionMailer::Base
20
20
  from "tester@example.com"
21
21
  body render(:inline => "Hello, <%= @world %>", :layout => false, :body => { :world => "Earth" })
22
22
  end
23
+
24
+ def multipart(recipient)
25
+ recipients recipient
26
+ subject "You have a mail"
27
+ from "tester@example.com"
28
+ end
23
29
  end
24
30
 
25
31
  class ExplicitLayoutMailer < ActionMailer::Base
@@ -56,6 +62,17 @@ class LayoutMailerTest < Test::Unit::TestCase
56
62
  assert_equal "Hello from layout Inside", mail.body.strip
57
63
  end
58
64
 
65
+ def test_should_pickup_multipart_layout
66
+ mail = AutoLayoutMailer.create_multipart(@recipient)
67
+ assert_equal 2, mail.parts.size
68
+
69
+ assert_equal 'text/plain', mail.parts.first.content_type
70
+ assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body
71
+
72
+ assert_equal 'text/html', mail.parts.last.content_type
73
+ assert_equal "Hello from layout text/html multipart", mail.parts.last.body
74
+ end
75
+
59
76
  def test_should_pickup_layout_given_to_render
60
77
  mail = AutoLayoutMailer.create_spam(@recipient)
61
78
  assert_equal "Spammer layout Hello, Earth", mail.body.strip
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.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ autorequire: action_mailer
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-20 00:00:00 +01:00
12
+ date: 2009-09-28 00:00:00 +13:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.2.2
23
+ version: 2.2.3
24
24
  version:
25
25
  description: Makes it trivial to test and deliver emails sent from a single service layer.
26
26
  email: david@loudthinking.com
@@ -36,7 +36,6 @@ files:
36
36
  - README
37
37
  - CHANGELOG
38
38
  - MIT-LICENSE
39
- - lib/action_mailer
40
39
  - lib/action_mailer/adv_attr_accessor.rb
41
40
  - lib/action_mailer/base.rb
42
41
  - lib/action_mailer/helpers.rb
@@ -47,12 +46,7 @@ files:
47
46
  - lib/action_mailer/test_case.rb
48
47
  - lib/action_mailer/test_helper.rb
49
48
  - lib/action_mailer/utils.rb
50
- - lib/action_mailer/vendor
51
- - lib/action_mailer/vendor/text-format-0.6.3
52
- - lib/action_mailer/vendor/text-format-0.6.3/text
53
49
  - lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
54
- - lib/action_mailer/vendor/tmail-1.2.3
55
- - lib/action_mailer/vendor/tmail-1.2.3/tmail
56
50
  - lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
57
51
  - lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb
58
52
  - lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb
@@ -86,26 +80,20 @@ files:
86
80
  - lib/actionmailer.rb
87
81
  - test/abstract_unit.rb
88
82
  - test/delivery_method_test.rb
89
- - test/fixtures
90
- - test/fixtures/auto_layout_mailer
91
83
  - test/fixtures/auto_layout_mailer/hello.html.erb
92
- - test/fixtures/explicit_layout_mailer
84
+ - test/fixtures/auto_layout_mailer/multipart.text.html.erb
85
+ - test/fixtures/auto_layout_mailer/multipart.text.plain.erb
93
86
  - test/fixtures/explicit_layout_mailer/logout.html.erb
94
87
  - test/fixtures/explicit_layout_mailer/signup.html.erb
95
- - test/fixtures/first_mailer
96
88
  - test/fixtures/first_mailer/share.erb
97
- - test/fixtures/helper_mailer
98
89
  - test/fixtures/helper_mailer/use_example_helper.erb
99
90
  - test/fixtures/helper_mailer/use_helper.erb
100
91
  - test/fixtures/helper_mailer/use_helper_method.erb
101
92
  - test/fixtures/helper_mailer/use_mail_helper.erb
102
- - test/fixtures/helpers
103
93
  - test/fixtures/helpers/example_helper.rb
104
- - test/fixtures/layouts
105
94
  - test/fixtures/layouts/auto_layout_mailer.html.erb
95
+ - test/fixtures/layouts/auto_layout_mailer.text.erb
106
96
  - test/fixtures/layouts/spam.html.erb
107
- - test/fixtures/path.with.dots
108
- - test/fixtures/path.with.dots/funky_path_mailer
109
97
  - test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
110
98
  - test/fixtures/raw_email
111
99
  - test/fixtures/raw_email10
@@ -123,11 +111,8 @@ files:
123
111
  - test/fixtures/raw_email_with_invalid_characters_in_content_type
124
112
  - test/fixtures/raw_email_with_nested_attachment
125
113
  - test/fixtures/raw_email_with_partially_quoted_subject
126
- - test/fixtures/second_mailer
127
114
  - test/fixtures/second_mailer/share.erb
128
- - test/fixtures/templates
129
115
  - test/fixtures/templates/signed_up.erb
130
- - test/fixtures/test_mailer
131
116
  - test/fixtures/test_mailer/_subtemplate.text.plain.erb
132
117
  - test/fixtures/test_mailer/body_ivar.erb
133
118
  - test/fixtures/test_mailer/custom_templating_extension.text.html.haml
@@ -153,6 +138,8 @@ files:
153
138
  - test/url_test.rb
154
139
  has_rdoc: true
155
140
  homepage: http://www.rubyonrails.org
141
+ licenses: []
142
+
156
143
  post_install_message:
157
144
  rdoc_options: []
158
145
 
@@ -173,9 +160,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
160
  requirements:
174
161
  - none
175
162
  rubyforge_project: actionmailer
176
- rubygems_version: 1.3.1
163
+ rubygems_version: 1.3.2
177
164
  signing_key:
178
- specification_version: 2
165
+ specification_version: 3
179
166
  summary: Service layer for easy email delivery and testing.
180
167
  test_files: []
181
168