summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2005-12-13 16:51:27 +0000
committermurphy <murphy@rubychan.de>2005-12-13 16:51:27 +0000
commit6492a0d689b2e739828aeec6dec691a49535e9eb (patch)
tree7994061ca4df877ec5d60d56d21ef311d63a4b95 /lib
parent952c57ba77b5a36111b9f82f8632e58208c998c4 (diff)
downloadcoderay-6492a0d689b2e739828aeec6dec691a49535e9eb.tar.gz
Plugin documentation updated.
Diffstat (limited to 'lib')
-rw-r--r--lib/coderay/helpers/plugin.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb
index 6c3ce76..67d55c8 100644
--- a/lib/coderay/helpers/plugin.rb
+++ b/lib/coderay/helpers/plugin.rb
@@ -270,12 +270,23 @@ module Plugin
self::PLUGIN_HOST
end
+ # Require some helper files.
+ #
+ # Example:
+ #
+ # class MyPlugin < PluginHost::BaseClass
+ # register_for :my_id
+ # helper :my_helper
+ #
+ # The above example loads the file myplugin/my_helper.rb relative to the
+ # file in which MyPlugin was defined.
def helper *helpers
for helper in helpers
self::PLUGIN_HOST.require_helper plugin_id, helper.to_s
end
end
+ # Returns the pulgin id used by the engine.
def plugin_id
name[/[\w_]+$/].downcase
end