diff options
Diffstat (limited to 'lib/chef/event_dispatch')
-rw-r--r-- | lib/chef/event_dispatch/dispatcher.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/chef/event_dispatch/dispatcher.rb b/lib/chef/event_dispatch/dispatcher.rb index c172a406d8..9f43f14311 100644 --- a/lib/chef/event_dispatch/dispatcher.rb +++ b/lib/chef/event_dispatch/dispatcher.rb @@ -25,11 +25,9 @@ class Chef # Define a method that will be forwarded to all def self.def_forwarding_method(method_name) - class_eval(<<-END_OF_METHOD, __FILE__, __LINE__) - def #{method_name}(*args) - @subscribers.each {|s| s.#{method_name}(*args)} - end - END_OF_METHOD + define_method(method_name) do |*args| + @subscribers.each { |s| s.send(method_name, *args) } + end end (Base.instance_methods - Object.instance_methods).each do |method_name| |