aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-08-25 21:22:34 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-25 21:22:34 -0700
commit172606e21f54fea39af68ede5f55a43deaf3ac68 (patch)
tree19c336e1ebc76a53a4d15b2573d7cce6fbad74c8 /actionmailer/lib
parentb7a37b742c0abd1df8ea48cc82f76385cc0c41ea (diff)
downloadrails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.gz
rails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.bz2
rails-172606e21f54fea39af68ede5f55a43deaf3ac68.zip
Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it.
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb
index 2e324d4637..2a9210deb9 100644
--- a/actionmailer/lib/action_mailer.rb
+++ b/actionmailer/lib/action_mailer.rb
@@ -21,13 +21,13 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-unless defined?(ActionController)
- begin
- $:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
+begin
+ require 'action_controller'
+rescue LoadError
+ actionpack_path = "#{File.dirname(__FILE__)}/../../actionpack/lib"
+ if File.directory?(actionpack_path)
+ $:.unshift actionpack_path
require 'action_controller'
- rescue LoadError
- require 'rubygems'
- gem 'actionpack', '>= 1.12.5'
end
end