diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-07 18:06:44 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-07 18:06:44 +0000 |
commit | e55426a798f6cd80f5a0f9a5937b90cc20341b72 (patch) | |
tree | a86923106d33400dc7e3746a8f360cba97f841a8 | |
parent | 0ceb9150d5daa3afed4fcf7afa29216a8f7132a1 (diff) | |
download | rails-e55426a798f6cd80f5a0f9a5937b90cc20341b72.tar.gz rails-e55426a798f6cd80f5a0f9a5937b90cc20341b72.tar.bz2 rails-e55426a798f6cd80f5a0f9a5937b90cc20341b72.zip |
Raise in stubby/init.rb if it doesn't have access to directory or config. loaded_plugins is a set of plugin names (so it will be usable with multiple paths, gems, etc).
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/lib/initializer.rb | 2 | ||||
-rw-r--r-- | railties/test/fixtures/plugins/default/stubby/init.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index e412091d18..31edd69f46 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -286,7 +286,7 @@ module Rails # Raises <tt>LoadError</tt> if the plugin is not found. def load_plugin(directory) name = File.basename(directory) - return false if loaded_plugins.include?(directory) + return false if loaded_plugins.include?(name) # Catch nonexistent and empty plugins. raise LoadError, "No such plugin: #{directory}" unless plugin_path?(directory) diff --git a/railties/test/fixtures/plugins/default/stubby/init.rb b/railties/test/fixtures/plugins/default/stubby/init.rb index fc9470fd97..81beeb0d32 100644 --- a/railties/test/fixtures/plugins/default/stubby/init.rb +++ b/railties/test/fixtures/plugins/default/stubby/init.rb @@ -1,2 +1,7 @@ +# I have access to my directory and the Rails config. +raise 'directory expected but undefined in init.rb' unless defined? directory +raise 'config expected but undefined in init.rb' unless defined? config + +# My lib/ dir must be in the load path. require 'stubby_mixin' -raise unless defined? StubbyMixin +raise 'missing mixin from my lib/ dir' unless defined? StubbyMixin |