From cb485c92efb4f10df99d351be5be85a4b7cfc283 2008-07-29 00:01:59 From: Eric Davis Date: 2008-07-29 00:01:59 Subject: [PATCH] Added Redmine::Plugin::Hook::Manager.clear_listeners to remove all hook listeners. --- diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index f34f16c..70f7331 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -191,6 +191,13 @@ module Redmine #:nodoc: puts "Listener added for #{hook_name.to_s}" end end + + # Removes all listeners + def clear_listeners() + @@hooks.each do |hook, registrations| + @@hooks[hook] = [] + end + end # Run all the hooks for +hook_name+ passing in +context+ def call_hook(hook_name, context = { })