summaryrefslogtreecommitdiff
path: root/lib/coderay/helpers/plugin.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-07-05 07:26:35 +0000
committermurphy <murphy@rubychan.de>2010-07-05 07:26:35 +0000
commitdfb0c922032ddaf9ddf5eb46a883f46715c0a50d (patch)
treea953f3312d0fbfa551f036cec1fe7a2d830472ef /lib/coderay/helpers/plugin.rb
parent6ce02e0b6c6f1d6ee0a225df6832205b95ad93e9 (diff)
downloadcoderay-dfb0c922032ddaf9ddf5eb46a883f46715c0a50d.tar.gz
Added all_plugins and all_titles methods to Plugin.
Diffstat (limited to 'lib/coderay/helpers/plugin.rb')
-rw-r--r--lib/coderay/helpers/plugin.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb
index ada5ae7..96bfdd6 100644
--- a/lib/coderay/helpers/plugin.rb
+++ b/lib/coderay/helpers/plugin.rb
@@ -188,6 +188,21 @@ module CodeRay
end
end
+ # Returns an array of all Plugins.
+ #
+ # Note: This loads all plugins using load_all.
+ def all_plugins
+ load_all
+ plugin_hash.values.grep(Class)
+ end
+
+ # Returns an array of all plugin titles.
+ #
+ # Note: This loads all plugins using load_all.
+ def all_titles
+ all_plugins.map { |plugin| plugin.title }
+ end
+
# Makes a map of all loaded plugins.
def inspect
map = plugin_hash.dup