diff options
Diffstat (limited to 'actionmailer')
-rwxr-xr-x | actionmailer/Rakefile | 7 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 8 | ||||
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 6 |
3 files changed, 11 insertions, 10 deletions
diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile index c09526cbef..612bd27774 100755 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -35,7 +35,7 @@ Rake::RDocTask.new { |rdoc| rdoc.title = "Action Mailer -- Easy email delivery and testing" rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' rdoc.options << '--charset' << 'utf-8' - rdoc.template = "#{ENV['template']}.rb" if ENV['template'] + rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README', 'CHANGELOG') rdoc.rdoc_files.include('lib/action_mailer.rb') rdoc.rdoc_files.include('lib/action_mailer/*.rb') @@ -76,12 +76,13 @@ end desc "Publish the API documentation" task :pgem => [:package] do - Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + `ssh wrath.rubyonrails.org './gemupdate.sh'` end desc "Publish the API documentation" task :pdoc => [:rdoc] do - Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/am", "doc").upload + Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload end desc "Publish the release files to RubyForge." diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index e065132107..1518e23dfe 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -426,8 +426,7 @@ module ActionMailer #:nodoc: end def template_root=(root) - write_inheritable_attribute(:template_root, root) - ActionView::TemplateFinder.process_view_paths(root) + write_inheritable_attribute(:template_root, ActionView::ViewLoadPaths.new(Array(root))) end end @@ -530,7 +529,7 @@ module ActionMailer #:nodoc: end def render_message(method_name, body) - render :file => method_name, :body => body + render :file => method_name, :body => body, :use_full_path => true end def render(opts) @@ -538,6 +537,7 @@ 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 @@ -546,7 +546,7 @@ module ActionMailer #:nodoc: end def initialize_template_class(assigns) - ActionView::Base.new([template_root], assigns, self) + ActionView::Base.new(template_root, assigns, self) end def sort_parts(parts, order = []) diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index e5ecb0e254..7f4a8817ca 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 + assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s) sub = Class.new(FunkyPathMailer) sub.template_root = 'test/path' - assert_equal 'test/path', sub.template_root - assert_equal expected, FunkyPathMailer.template_root + assert_equal ['test/path'], sub.template_root.map(&:to_s) + assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s) end end |