From 172606e21f54fea39af68ede5f55a43deaf3ac68 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 25 Aug 2008 21:22:34 -0700 Subject: Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it. --- actionmailer/lib/action_mailer.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionmailer/lib') 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 -- cgit v1.2.3