diff options
author | murphy <murphy@rubychan.de> | 2010-07-05 07:26:35 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-07-05 07:26:35 +0000 |
commit | dfb0c922032ddaf9ddf5eb46a883f46715c0a50d (patch) | |
tree | a953f3312d0fbfa551f036cec1fe7a2d830472ef /lib/coderay/helpers/plugin.rb | |
parent | 6ce02e0b6c6f1d6ee0a225df6832205b95ad93e9 (diff) | |
download | coderay-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.rb | 15 |
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 |