summaryrefslogtreecommitdiff
path: root/lib/coderay/helpers
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-06-09 10:41:06 +0000
committermurphy <murphy@rubychan.de>2009-06-09 10:41:06 +0000
commit052399c510acf6bb5ae374b7270acbdf9b861b71 (patch)
tree2d9d6949596dd60cebd1be3925704cf7c4eeb809 /lib/coderay/helpers
parent90d4db43872599ba53fa50836542eab5fb8ff42b (diff)
downloadcoderay-052399c510acf6bb5ae374b7270acbdf9b861b71.tar.gz
New: Plugin.title (closes #96)
The title saves the real name for a language, like "C++"...something that can't be deduced from the class name. And a version fix in the README.
Diffstat (limited to 'lib/coderay/helpers')
-rw-r--r--lib/coderay/helpers/plugin.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb
index 3aa79e4..922c528 100644
--- a/lib/coderay/helpers/plugin.rb
+++ b/lib/coderay/helpers/plugin.rb
@@ -281,6 +281,14 @@ module Plugin
plugin_host.register self, *ids
end
+ def title title = nil
+ if title
+ @title = title.to_s
+ else
+ @title ||= name[/([^:]+)$/, 1]
+ end
+ end
+
# The host for this Plugin class.
def plugin_host host = nil
if host and not host.is_a? PluginHost