summaryrefslogtreecommitdiff
path: root/lib/coderay/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/helpers')
-rw-r--r--lib/coderay/helpers/file_type.rb4
-rw-r--r--lib/coderay/helpers/plugin.rb12
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb
index ea7125f..c752a03 100644
--- a/lib/coderay/helpers/file_type.rb
+++ b/lib/coderay/helpers/file_type.rb
@@ -90,7 +90,7 @@ module CodeRay
'h' => :c,
'htm' => :page,
'html' => :page,
- 'html.erb' => :rhtml,
+ 'html.erb' => :erb,
'java' => :java,
'js' => :java_script,
'json' => :json,
@@ -109,7 +109,7 @@ module CodeRay
'raydebug' => :raydebug,
'rb' => :ruby,
'rbw' => :ruby,
- 'rhtml' => :rhtml,
+ 'rhtml' => :erb,
'rjs' => :ruby,
'rpdf' => :ruby,
'ru' => :ruby,
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