diff options
author | murphy <murphy@rubychan.de> | 2010-05-01 00:26:23 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-05-01 00:26:23 +0000 |
commit | e271dc13633fa6dba9fb87f415d72505af0cc88c (patch) | |
tree | 03cb0d8de4538f6eec3481ec720f02cfdc9adf1f /lib/coderay | |
parent | a8838f7ff6ab44e468a600ffa20adc96c3820fc3 (diff) | |
download | coderay-e271dc13633fa6dba9fb87f415d72505af0cc88c.tar.gz |
Improved behavior of Plugin#register_for.
Diffstat (limited to 'lib/coderay')
-rw-r--r-- | lib/coderay/helpers/plugin.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 2dffbdc..ba62983 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -278,6 +278,7 @@ module Plugin # # See PluginHost.register. def register_for *ids + @plugin_id = ids.first plugin_host.register self, *ids end @@ -320,14 +321,14 @@ module Plugin if helper.is_a?(String) && helper[/\//] self::PLUGIN_HOST.require_helper $`, $' else - self::PLUGIN_HOST.require_helper plugin_id, helper.to_s + self::PLUGIN_HOST.require_helper plugin_id.to_s, helper.to_s end end end # Returns the pulgin id used by the engine. def plugin_id - name[/\w+$/].downcase + @plugin_id || name[/\w+$/].downcase end end |