From 5cf118b1384bce266c76d3f4a12e761bbcb130ab Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 27 Dec 2006 22:18:38 +0000 Subject: Ensure plugins are in the Dependencies.load_once_paths collection by default. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5801 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 5 +++++ railties/lib/initializer.rb | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 06d1419368..302782c73a 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,10 @@ *SVN* +* Ensure plugins are in the Dependencies.load_once_paths collection by default. [Rick] + If you really want your plugins to reload, add this to the very top of init.rb: + + Dependencies.load_once_paths.delete(lib_path) + * Allow config.to_prepare to work, make the dispatcher safe to 're require'. [Koz, Nicholas Seckar] * Fix scaffold_resource generator so it respects the --pretend argument when creating the routes file. Closes #6852 [fearoffish] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index c7f32d767a..6bb65d3871 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -388,6 +388,7 @@ module Rails application_lib_index = $LOAD_PATH.index(File.join(RAILS_ROOT, "lib")) || 0 $LOAD_PATH.insert(application_lib_index + 1, lib_path) Dependencies.load_paths << lib_path + Dependencies.load_once_paths << lib_path end # Allow plugins to reference the current configuration object @@ -612,11 +613,9 @@ module Rails paths.concat builtin_directories end + # Doesn't matter since plugins aren't in load_paths yet. def default_load_once_paths - plugin_root = "#{root_path}/vendor/plugins/" - default_load_paths.select do |path| - path[0, plugin_root.length] == plugin_root # No begins_with yet - end + [] end def default_log_path -- cgit v1.2.3