Skip to content

Commit

Permalink
Load plugins in a consistent order. Closes #3429
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
NZKoz committed Jan 14, 2006
1 parent 32f89dc commit 88dae72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions 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]
Expand Down
5 changes: 3 additions & 2 deletions railties/lib/initializer.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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|
Expand Down

0 comments on commit 88dae72

Please sign in to comment.