diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 17:08:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 17:08:09 +0000 |
commit | a5af3f75af86ff0abd9964bfd69483d116c12b13 (patch) | |
tree | 5e16778559fce11a84117e6fe38e6e2b4bb0a572 /railties/lib | |
parent | e38ad5ddcc1de38ff485d3d78d9c72283320cdaf (diff) | |
download | rails-a5af3f75af86ff0abd9964bfd69483d116c12b13.tar.gz rails-a5af3f75af86ff0abd9964bfd69483d116c12b13.tar.bz2 rails-a5af3f75af86ff0abd9964bfd69483d116c12b13.zip |
Added symbols as a legal way of specifying plugins in config.plugins (closes #9629) [tom]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 5 | ||||
-rw-r--r-- | railties/lib/rails/plugin/loader.rb | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 111b5237ba..3183b0a34a 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -429,7 +429,10 @@ module Rails # The list of plugins to load. If this is set to <tt>nil</tt>, all plugins will # be loaded. If this is set to <tt>[]</tt>, no plugins will be loaded. Otherwise, # plugins will be loaded in the order specified. - attr_accessor :plugins + attr_reader :plugins + def plugins=(plugins) + @plugins = plugins.nil? ? nil : plugins.map { |p| p.to_sym } + end # The path to the root of the plugins directory. By default, it is in # <tt>vendor/plugins</tt>. diff --git a/railties/lib/rails/plugin/loader.rb b/railties/lib/rails/plugin/loader.rb index e935f9b34b..016bcc6c50 100644 --- a/railties/lib/rails/plugin/loader.rb +++ b/railties/lib/rails/plugin/loader.rb @@ -13,7 +13,7 @@ module Rails def initialize(initializer, directory) @initializer = initializer @directory = directory - @name = File.basename(directory) + @name = File.basename(directory).to_sym end def load @@ -126,7 +126,7 @@ module Rails end if !explicitly_enabled? && !other_plugin_loader.explicitly_enabled? - name <=> other_plugin_loader.name + name.to_s <=> other_plugin_loader.name.to_s elsif registered_plugins.include?(:all) && (!explicitly_enabled? || !other_plugin_loader.explicitly_enabled?) effective_index = explicitly_enabled? ? registered_plugins.index(name) : registered_plugins.index(:all) other_effective_index = other_plugin_loader.explicitly_enabled? ? @@ -138,7 +138,7 @@ module Rails end else - name <=> other_plugin_loader.name + name.to_s <=> other_plugin_loader.name.to_s end end end |