From cb485c92efb4f10df99d351be5be85a4b7cfc283 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 28 Jul 2008 17:01:59 -0700 Subject: [PATCH] Added Redmine::Plugin::Hook::Manager.clear_listeners to remove all hook listeners. --- lib/redmine/plugin.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index f34f16c62..70f7331b8 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 = { })