Browse files

Raise in stubby/init.rb if it doesn't have access to directory or con…

…fig. loaded_plugins is a set of plugin names (so it will be usable with multiple paths, gems, etc).

git-svn-id: 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
jeremy committed Nov 7, 2005
1 parent 0ceb915 commit e55426a798f6cd80f5a0f9a5937b90cc20341b72
Showing with 7 additions and 2 deletions.
  1. +1 −1 railties/lib/initializer.rb
  2. +6 −1 railties/test/fixtures/plugins/default/stubby/init.rb
@@ -286,7 +286,7 @@ def plugin_path?(path)
# 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)
@@ -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

0 comments on commit e55426a

Please sign in to comment.