From 0432d151647f2178ddee79979827d552447c251f Mon Sep 17 00:00:00 2001
From: Pratik Naik <pratiknaik@gmail.com>
Date: Wed, 16 Jul 2008 13:00:36 +0100
Subject: Merge with docrails.

---
 actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb   | 4 ++--
 actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb    | 2 +-
 actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb | 2 +-
 actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb      | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'actionmailer')

diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
index fa8e5bcd8c..982ad5b661 100644
--- a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
+++ b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb
@@ -38,7 +38,7 @@ module TMail
   # = Class Address
   # 
   # Provides a complete handling library for email addresses. Can parse a string of an
-  # address directly or take in preformatted addresses themseleves.  Allows you to add
+  # address directly or take in preformatted addresses themselves.  Allows you to add
   # and remove phrases from the front of the address and provides a compare function for
   # email addresses.
   # 
@@ -143,7 +143,7 @@ module TMail
       
       # This is to catch an unquoted "@" symbol in the local part of the
       # address.  Handles addresses like <"@"@me.com> and makes sure they
-      # stay like <"@"@me.com> (previously were becomming <@@me.com>)
+      # stay like <"@"@me.com> (previously were becoming <@@me.com>)
       if local && (local.join == '@' || local.join =~ /\A[^"].*?@.*?[^"]\Z/)
         @local = "\"#{local.join}\""
       else
diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
index 9153dcd7c6..dbdefcf979 100644
--- a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
+++ b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb
@@ -59,7 +59,7 @@ module TMail
       #
       # This is because a mailbox doesn't have the : after the From that designates the
       # beginning of the envelope sender (which can be different to the from address of 
-      # the emial)
+      # the email)
       #
       # Other fields can be passed as normal, "Reply-To", "Received" etc.
       #
diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
index a6d428d7d6..2fc2dbdfc7 100644
--- a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
+++ b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb
@@ -42,7 +42,7 @@ module TMail
     # Allows you to query the mail object with a string to get the contents
     # of the field you want.
     # 
-    # Returns a string of the exact contnts of the field
+    # Returns a string of the exact contents of the field
     # 
     #  mail.from = "mikel <mikel@lindsaar.net>"
     #  mail.header_string("From") #=> "mikel <mikel@lindsaar.net>"
diff --git a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
index 5a319907ae..c3a8803dc4 100644
--- a/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
+++ b/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb
@@ -255,7 +255,7 @@ module TMail
     alias fetch []
 
     # Allows you to set or delete TMail header objects at will.
-    # Eamples:
+    # Examples:
     #  @mail = TMail::Mail.new
     #  @mail['to'].to_s       # => 'mikel@test.com.au'
     #  @mail['to'] = 'mikel@elsewhere.org'
@@ -265,7 +265,7 @@ module TMail
     #  @mail['to'].to_s       # => nil
     #  @mail.encoded          # => "\r\n"
     # 
-    # Note: setting mail[] = nil actualy deletes the header field in question from the object,
+    # Note: setting mail[] = nil actually deletes the header field in question from the object,
     # it does not just set the value of the hash to nil
     def []=( key, val )
       dkey = key.downcase
-- 
cgit v1.2.3


From b74b97fef5d94f91d6fbf9aec20516c7fe4ce24d Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Sat, 19 Jul 2008 11:14:12 -0500
Subject: Update uses_mocha in ActionMailer and ActiveResource

---
 actionmailer/test/abstract_unit.rb | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

(limited to 'actionmailer')

diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb
index 11058a770d..107b2e8bbe 100644
--- a/actionmailer/test/abstract_unit.rb
+++ b/actionmailer/test/abstract_unit.rb
@@ -30,12 +30,20 @@ class Net::SMTP
   end
 end
 
-# Wrap tests that use Mocha and skip if unavailable.
-def uses_mocha(test_name)
-  gem 'mocha', ">=0.9.0"
+def uses_gem(gem_name, test_name, version = '> 0')
+  require 'rubygems'
+  gem gem_name.to_s, version
+  require gem_name.to_s
   yield
-rescue Gem::LoadError
-  $stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again."
+rescue LoadError
+  $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
+end
+
+# Wrap tests that use Mocha and skip if unavailable.
+unless defined? uses_mocha
+  def uses_mocha(test_name, &block)
+    uses_gem('mocha', test_name, '>= 0.5.5', &block)
+  end
 end
 
 def set_delivery_method(delivery_method)
-- 
cgit v1.2.3


From 746122735269b9077c7d5d99d88e8b22d88ad8d5 Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Sat, 19 Jul 2008 12:23:08 -0500
Subject: Ruby 1.9: Call join on template_root instead of to_s

---
 actionmailer/lib/action_mailer/base.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'actionmailer')

diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 5a71935009..e4920f0c86 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -529,7 +529,7 @@ module ActionMailer #:nodoc:
       end
 
       def render_message(method_name, body)
-        render :file => method_name, :body => body, :use_full_path => true
+        render :file => method_name, :body => body
       end
 
       def render(opts)
@@ -537,12 +537,11 @@ module ActionMailer #:nodoc:
         if opts[:file] && opts[:file] !~ /\//
           opts[:file] = "#{mailer_name}/#{opts[:file]}"
         end
-        opts[:use_full_path] = true
         initialize_template_class(body).render(opts)
       end
 
       def template_path
-        "#{template_root}/#{mailer_name}"
+        "#{template_root.join}/#{mailer_name}"
       end
 
       def initialize_template_class(assigns)
-- 
cgit v1.2.3


From e23156e87bd32206a5ea529fbecc04fdf37d7bc2 Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Sat, 19 Jul 2008 12:35:42 -0500
Subject: Only create a path for ActionMailer template root instead of a path
 set. Better fix than 7461227

---
 actionmailer/lib/action_mailer/base.rb | 4 ++--
 actionmailer/test/mail_service_test.rb | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'actionmailer')

diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index e4920f0c86..bf60e2f3d5 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -426,7 +426,7 @@ module ActionMailer #:nodoc:
       end
 
       def template_root=(root)
-        write_inheritable_attribute(:template_root, ActionView::PathSet.new(Array(root)))
+        write_inheritable_attribute(:template_root, ActionView::PathSet::Path.new(root))
       end
     end
 
@@ -541,7 +541,7 @@ module ActionMailer #:nodoc:
       end
 
       def template_path
-        "#{template_root.join}/#{mailer_name}"
+        "#{template_root}/#{mailer_name}"
       end
 
       def initialize_template_class(assigns)
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index 7f4a8817ca..e5ecb0e254 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -942,13 +942,13 @@ end # uses_mocha
 class InheritableTemplateRootTest < Test::Unit::TestCase
   def test_attr
     expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
-    assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s)
+    assert_equal expected, FunkyPathMailer.template_root
 
     sub = Class.new(FunkyPathMailer)
     sub.template_root = 'test/path'
 
-    assert_equal ['test/path'], sub.template_root.map(&:to_s)
-    assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s)
+    assert_equal 'test/path', sub.template_root
+    assert_equal expected, FunkyPathMailer.template_root
   end
 end
 
-- 
cgit v1.2.3


From 55bfe6be52da1130abb1c148f10d8e9a11368ffd Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Sat, 19 Jul 2008 15:27:55 -0500
Subject: Ensure ActionView::PathSet::Path is not initialized with a
 precompiled path

---
 actionmailer/lib/action_mailer/base.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'actionmailer')

diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index bf60e2f3d5..a43296461b 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -426,7 +426,8 @@ module ActionMailer #:nodoc:
       end
 
       def template_root=(root)
-        write_inheritable_attribute(:template_root, ActionView::PathSet::Path.new(root))
+        root = ActionView::PathSet::Path.new(root) if root.is_a?(String)
+        write_inheritable_attribute(:template_root, root)
       end
     end
 
-- 
cgit v1.2.3