From 445873af19208b048a2304b08d5a69285ff3a6b7 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 5 Oct 2005 18:28:34 +0000 Subject: prepend to load path before loading the plugin git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/initializer.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index fedce9c5a7..2fd22f9743 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -72,15 +72,15 @@ module Rails Dir.glob("#{configuration.plugins_path}/*") do |directory| next if File.basename(directory)[0] == ?. || !File.directory?(directory) + if File.directory?("#{directory}/lib") + $LOAD_PATH.unshift "#{directory}/lib" + end + if File.exist?("#{directory}/init.rb") silence_warnings do eval(IO.read("#{directory}/init.rb"), binding) end end - - if File.directory?("#{directory}/lib") - $LOAD_PATH.unshift "#{directory}/lib" - end end $LOAD_PATH.uniq! -- cgit v1.2.3