From 052399c510acf6bb5ae374b7270acbdf9b861b71 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 9 Jun 2009 10:41:06 +0000 Subject: 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. --- lib/coderay/helpers/plugin.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/coderay/helpers/plugin.rb') 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 -- cgit v1.2.1