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
This commit is contained in:
parent
0ceb9150d5
commit
e55426a798
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user