diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-07-03 13:01:39 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-07-03 13:01:39 +0100 |
commit | 2fe263bb328c20539f2970057f31e567ec4ab7c8 (patch) | |
tree | 63e85164fb09aca6beb78e1a5c52424fa49ed098 /actionmailer | |
parent | bf5ac9965f12840d469ef2a4a16e8205dbbe5253 (diff) | |
parent | a4bdc00fec623f72592e663e6d7830eea0bc6ea4 (diff) | |
download | rails-2fe263bb328c20539f2970057f31e567ec4ab7c8.tar.gz rails-2fe263bb328c20539f2970057f31e567ec4ab7c8.tar.bz2 rails-2fe263bb328c20539f2970057f31e567ec4ab7c8.zip |
Merge commit 'mainstream/master'
Conflicts:
actionpack/lib/action_controller.rb
actionpack/lib/action_controller/base/base.rb
actionpack/lib/action_view/template/path.rb
activesupport/lib/active_support/json/encoders/hash.rb
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/Rakefile | 5 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer.rb | 13 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 6 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/helpers.rb | 17 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/version.rb | 6 | ||||
-rw-r--r-- | actionmailer/test/abstract_unit.rb | 3 |
6 files changed, 23 insertions, 27 deletions
diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile index 24c25abc8b..ebcca0d246 100644 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -4,7 +4,6 @@ require 'rake/testtask' require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' -require 'rake/contrib/sshpublisher' require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version') PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' @@ -61,7 +60,7 @@ spec = Gem::Specification.new do |s| s.rubyforge_project = "actionmailer" s.homepage = "http://www.rubyonrails.org" - s.add_dependency('actionpack', '= 2.3.2' + PKG_BUILD) + s.add_dependency('actionpack', '= 3.0.pre' + PKG_BUILD) s.has_rdoc = true s.requirements << 'none' @@ -82,12 +81,14 @@ end desc "Publish the API documentation" task :pgem => [:package] do + require 'rake/contrib/sshpublisher' Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` end desc "Publish the API documentation" task :pdoc => [:rdoc] do + require 'rake/contrib/sshpublisher' Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload end diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb index 02c536c8ad..a427376579 100644 --- a/actionmailer/lib/action_mailer.rb +++ b/actionmailer/lib/action_mailer.rb @@ -21,16 +21,9 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -begin - require 'action_controller' -rescue LoadError - actionpack_path = "#{File.dirname(__FILE__)}/../../actionpack/lib" - if File.directory?(actionpack_path) - $:.unshift actionpack_path - require 'action_controller' - end -end - +actionpack_path = "#{File.dirname(__FILE__)}/../../actionpack/lib" +$:.unshift(actionpack_path) if File.directory?(actionpack_path) +require 'action_controller' require 'action_view' module ActionMailer diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index af2cc2ee24..b5a0d0ab96 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -1,3 +1,7 @@ +require "active_support/core_ext/class" +# Use the old layouts until actionmailer gets refactored +require "action_controller/legacy/layout" + module ActionMailer #:nodoc: # Action Mailer allows you to send email from your application using a mailer model and views. # @@ -697,7 +701,7 @@ module ActionMailer #:nodoc: def perform_delivery_smtp(mail) destinations = mail.destinations mail.ready_to_send - sender = (mail['return-path'] && mail['return-path'].spec) || mail.from + sender = (mail['return-path'] && mail['return-path'].spec) || mail['from'] smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port]) smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto) diff --git a/actionmailer/lib/action_mailer/helpers.rb b/actionmailer/lib/action_mailer/helpers.rb index 31f7de8d60..1bb8682315 100644 --- a/actionmailer/lib/action_mailer/helpers.rb +++ b/actionmailer/lib/action_mailer/helpers.rb @@ -48,13 +48,14 @@ module ActionMailer file_name = arg.to_s.underscore + '_helper' class_name = file_name.camelize - begin - require_dependency(file_name) - rescue LoadError => load_error - requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1] - msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" - raise LoadError.new(msg).copy_blame!(load_error) - end + require_dependency(file_name, "Missing helper file helpers/%s.rb") + # begin + # require_dependency(file_name) + # rescue LoadError => load_error + # requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1] + # msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" + # raise LoadError.new(msg).copy_blame!(load_error) + # end add_template_helper(class_name.constantize) else @@ -97,7 +98,7 @@ module ActionMailer child.master_helper_module.__send__(:include, master_helper_module) child.helper child.name.to_s.underscore rescue MissingSourceFile => e - raise unless e.is_missing?("helpers/#{child.name.to_s.underscore}_helper") + raise unless e.is_missing?("#{child.name.to_s.underscore}_helper") end end end diff --git a/actionmailer/lib/action_mailer/version.rb b/actionmailer/lib/action_mailer/version.rb index 08ff0d2ffb..0f2b58552b 100644 --- a/actionmailer/lib/action_mailer/version.rb +++ b/actionmailer/lib/action_mailer/version.rb @@ -1,8 +1,8 @@ module ActionMailer module VERSION #:nodoc: - MAJOR = 2 - MINOR = 3 - TINY = 2 + MAJOR = 3 + MINOR = 0 + TINY = "pre" STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index 51b375fef3..3d4d0fb995 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -1,9 +1,6 @@ require 'rubygems' require 'test/unit' -gem 'mocha', '>= 0.9.5' -require 'mocha' - $:.unshift "#{File.dirname(__FILE__)}/../lib" $:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" $:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib" |