diff options
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/helpers/plugin.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 4ae8e7a..6f074c3 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -303,9 +303,17 @@ module Plugin # # The above example loads the file myplugin/my_helper.rb relative to the # file in which MyPlugin was defined. + # + # You can also load a helper from a different plugin: + # + # helper 'other_plugin/other_helper' def helper *helpers for helper in helpers - self::PLUGIN_HOST.require_helper plugin_id, helper.to_s + if helper.is_a?(String) && helper[/\//] + self::PLUGIN_HOST.require_helper $`, $' + else + self::PLUGIN_HOST.require_helper plugin_id, helper.to_s + end end end |