Browse files

Load plugins in a consistent order. Closes #3429

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 32f89dc commit 88dae722022b84bc7b16680f5113959952fb2df2 @NZKoz NZKoz committed Jan 14, 2006
Showing with 5 additions and 2 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +3 −2 railties/lib/initializer.rb
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Sort the list of plugins so we load in a consistent order [Rick Olson]
+
* Show usage when script/plugin is called without arguments [tom@craz8.com]
* Corrected problems with plugin loader where plugins set 'name' incorrectly #3297 [anna@wota.jp]
View
5 railties/lib/initializer.rb
@@ -141,8 +141,9 @@ def load_framework_info
# * evaluate <tt>init.rb</tt> if present
#
# After all plugins are loaded, duplicates are removed from the load path.
+ # Plugins are loaded in alphabetical order.
def load_plugins
- find_plugins(configuration.plugin_paths).each { |path| load_plugin path }
+ find_plugins(configuration.plugin_paths).sort.each { |path| load_plugin path }
$LOAD_PATH.uniq!
end
@@ -262,7 +263,7 @@ def initialize_framework_settings
# Return a list of plugin paths within base_path. A plugin path is
# a directory that contains either a lib directory or an init.rb file.
# This recurses into directories which are not plugin paths, so you
- # may organize your plugins which the plugin path.
+ # may organize your plugins within the plugin path.
def find_plugins(*base_paths)
base_paths.flatten.inject([]) do |plugins, base_path|
Dir.glob(File.join(base_path, '*')).each do |path|

0 comments on commit 88dae72

Please sign in to comment.