diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2011-08-19 03:09:35 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2011-08-19 03:09:35 +0200 |
commit | 75bc5455af8c3c3381066aac3d5fff42264cac6f (patch) | |
tree | 589d2c912ddd94c517eb794bcdf3257f8348f3c0 /lib/coderay/helpers/plugin.rb | |
parent | fdd17b6a09efb275238a3baef275465d31452f2a (diff) | |
download | coderay-75bc5455af8c3c3381066aac3d5fff42264cac6f.tar.gz |
Major rewrite of encoders to support IO output; fixed some minor scanner bugs; cleanups; dropped NitroXHTML scanner; improved tests
Diffstat (limited to 'lib/coderay/helpers/plugin.rb')
-rw-r--r-- | lib/coderay/helpers/plugin.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 8a8e149..06c1233 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -114,9 +114,10 @@ module CodeRay def default id = nil if id id = validate_id id - plugin_hash[nil] = id + raise "The default plugin can't be named \"default\"." if id == :default + plugin_hash[:default] = id else - load nil + load :default end end @@ -179,10 +180,11 @@ module CodeRay require path rescue LoadError => boom if @plugin_map_loaded - if h.has_key?(nil) # default plugin - h[nil] + if h.has_key?(:default) + warn '%p could not load plugin %p; falling back to %p' % [self, id, h[:default]] + h[:default] else - raise PluginNotFound, 'Could not load plugin %p: %s' % [id, boom] + raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom] end else load_plugin_map |