From 6492a0d689b2e739828aeec6dec691a49535e9eb Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 13 Dec 2005 16:51:27 +0000 Subject: Plugin documentation updated. --- lib/coderay/helpers/plugin.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/coderay') 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 -- cgit v1.2.1