]> source.dussan.org Git - redmine.git/commitdiff
Added Redmine::Plugin::Hook::Manager.clear_listeners to remove all hook listeners.
authorEric Davis <edavis@littlestreamsoftware.com>
Tue, 29 Jul 2008 00:01:59 +0000 (17:01 -0700)
committerEric Davis <edavis@littlestreamsoftware.com>
Tue, 29 Jul 2008 00:01:59 +0000 (17:01 -0700)
lib/redmine/plugin.rb

index f34f16c6282026d63e473fe347eacbd7bde8f712..70f7331b8e672b06d570a062d4871914279f60bc 100644 (file)
@@ -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 = { })