actionmailer 0.5.0 → 0.6.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 CHANGED
@@ -1,3 +1,10 @@
1
+ *0.6* (January 17th, 2005)
2
+
3
+ * Fixed that bcc and cc should be settable through @bcc and @cc -- not just @headers["Bcc"] and @headers["Cc"] #453 [Eric Hodel]
4
+
5
+ * Fixed Action Mailer to be "warnings safe" so you can run with ruby -w and not get framework warnings #453 [Eric Hodel]
6
+
7
+
1
8
  *0.5*
2
9
 
3
10
  * Added access to custom headers, like cc, bcc, and reply-to #268 [Andreas Schwarz]. Example:
@@ -86,6 +86,7 @@ module ActionMailer #:nodoc:
86
86
  attr_accessor :recipients, :subject, :body, :from, :sent_on, :headers, :bcc, :cc
87
87
 
88
88
  def initialize
89
+ @bcc = @cc = @from = @recipients = @sent_on = @subject = @body = nil
89
90
  @headers = {}
90
91
  end
91
92
 
@@ -147,15 +148,16 @@ module ActionMailer #:nodoc:
147
148
  mailer.body = {}
148
149
  mailer.send(method_name, *parameters)
149
150
 
150
- if String === mailer.body
151
- mail = create(mailer.recipients, mailer.subject, mailer.body, mailer.from, mailer.sent_on, mailer.headers)
152
- else
153
- mail = create(mailer.recipients, mailer.subject, render_body(mailer, method_name), mailer.from, mailer.sent_on, mailer.headers)
151
+ unless String === mailer.body then
152
+ mailer.body = render_body mailer, method_name
154
153
  end
155
154
 
156
- mail.bcc = @bcc if @bcc
157
- mail.cc = @cc if @cc
158
-
155
+ mail = create(mailer.recipients, mailer.subject, mailer.body,
156
+ mailer.from, mailer.sent_on, mailer.headers)
157
+
158
+ mail.bcc = mailer.bcc unless mailer.bcc.nil?
159
+ mail.cc = mailer.cc unless mailer.cc.nil?
160
+
159
161
  return mail
160
162
  end
161
163
 
@@ -1,4 +1,3 @@
1
1
  require 'tmail/info'
2
2
  require 'tmail/mail'
3
3
  require 'tmail/mailbox'
4
- require 'tmail/obsolete'
data/rakefile CHANGED
@@ -8,7 +8,7 @@ require 'rake/contrib/rubyforgepublisher'
8
8
 
9
9
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
10
10
  PKG_NAME = 'actionmailer'
11
- PKG_VERSION = '0.5.0' + PKG_BUILD
11
+ PKG_VERSION = '0.6.0' + PKG_BUILD
12
12
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
13
13
 
14
14
  desc "Default Task"
@@ -72,13 +72,13 @@ end
72
72
  # Publish beta gem
73
73
  desc "Publish the API documentation"
74
74
  task :pgem => [:package] do
75
- Rake::SshFilePublisher.new("davidhh@one.textdrive.com", "domains/rubyonrails.org/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
75
+ Rake::SshFilePublisher.new("davidhh@comox.textdrive.com", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
76
76
  end
77
77
 
78
78
  # Publish documentation
79
79
  desc "Publish the API documentation"
80
80
  task :pdoc => [:rdoc] do
81
- Rake::SshDirPublisher.new("davidhh@one.textdrive.com", "domains/rubyonrails.org/am", "doc").upload
81
+ Rake::SshDirPublisher.new("davidhh@comox.textdrive.com", "public_html/am", "doc").upload
82
82
  end
83
83
 
84
84
  desc "Publish to RubyForge"
@@ -4,6 +4,7 @@ require 'test/unit'
4
4
  require 'action_mailer'
5
5
 
6
6
  class TestMailer < ActionMailer::Base
7
+
7
8
  def signed_up(recipient)
8
9
  @recipients = recipient
9
10
  @subject = "[Signed up] Welcome #{recipient}"
@@ -19,11 +20,23 @@ class TestMailer < ActionMailer::Base
19
20
  @sent_on = Time.local(2004, 12, 12)
20
21
  @body = "Goodbye, Mr. #{recipient}"
21
22
  end
23
+
24
+ def cc_bcc(recipient)
25
+ @recipients = recipient
26
+ @subject = "testing bcc/cc"
27
+ @from = "system@loudthinking.com"
28
+ @sent_on = Time.local 2004, 12, 12
29
+ @cc = "nobody@loudthinking.com"
30
+ @bcc = "root@loudthinking.com"
31
+ @body = "Nothing to see here."
32
+ end
33
+
22
34
  end
23
35
 
24
36
  TestMailer.template_root = File.dirname(__FILE__) + "/fixtures"
25
37
 
26
38
  class ActionMailerTest < Test::Unit::TestCase
39
+
27
40
  def setup
28
41
  ActionMailer::Base.delivery_method = :test
29
42
  ActionMailer::Base.perform_deliveries = true
@@ -68,6 +81,31 @@ class ActionMailerTest < Test::Unit::TestCase
68
81
  assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
69
82
  end
70
83
 
84
+ def test_cc_bcc
85
+ expected = TMail::Mail.new
86
+ expected.to = @recipient
87
+ expected.subject = "testing bcc/cc"
88
+ expected.body = "Nothing to see here."
89
+ expected.from = "system@loudthinking.com"
90
+ expected.cc = "nobody@loudthinking.com"
91
+ expected.bcc = "root@loudthinking.com"
92
+ expected.date = Time.local 2004, 12, 12
93
+
94
+ created = nil
95
+ assert_nothing_raised do
96
+ created = TestMailer.create_cc_bcc @recipient
97
+ end
98
+ assert_not_nil created
99
+ assert_equal expected.encoded, created.encoded
100
+
101
+ assert_nothing_raised do
102
+ TestMailer.deliver_cc_bcc @recipient
103
+ end
104
+
105
+ assert_not_nil ActionMailer::Base.deliveries.first
106
+ assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
107
+ end
108
+
71
109
  def test_instances_are_nil
72
110
  assert_nil ActionMailer::Base.new
73
111
  assert_nil TestMailer.new
@@ -89,4 +127,6 @@ class ActionMailerTest < Test::Unit::TestCase
89
127
  TestMailer.deliver_signed_up(@recipient)
90
128
  assert_equal 1, ActionMailer::Base.deliveries.size
91
129
  end
130
+
92
131
  end
132
+
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.1
2
+ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: actionmailer
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.0
7
- date: 2004-12-16
6
+ version: 0.6.0
7
+ date: 2005-01-17
8
8
  summary: Service layer for easy email delivery and testing.
9
9
  require_paths:
10
10
  - lib
11
- author: David Heinemeier Hansson
12
11
  email: david@loudthinking.com
13
12
  homepage: http://actionmailer.rubyonrails.org
14
13
  rubyforge_project: actionmailer
@@ -25,6 +24,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
24
  version: 0.0.0
26
25
  version:
27
26
  platform: ruby
27
+ authors:
28
+ - David Heinemeier Hansson
28
29
  files:
29
30
  - rakefile
30
31
  - install.rb