diff options
author | Ranjib Dey <dey.ranjib@gmail.com> | 2015-07-16 09:39:02 -0700 |
---|---|---|
committer | Ranjib Dey <dey.ranjib@gmail.com> | 2015-07-16 09:39:02 -0700 |
commit | 339dbb2d05bee1a0525388941ca2409be8f62ce1 (patch) | |
tree | 3cce812a51d371c432bce02b140b96ce5389c1d5 /lib/chef/chef_class.rb | |
parent | 9a3e6e04f3bb39c2b2f5749719f0c21dd3f3f2ec (diff) | |
parent | fce939cbafe91eaade275d44c4e1cc5bfa724b2c (diff) | |
download | chef-339dbb2d05bee1a0525388941ca2409be8f62ce1.tar.gz |
Merge pull request #3242 from ranjib/chef_handler
[RFC-039] chef handler dsl
Diffstat (limited to 'lib/chef/chef_class.rb')
-rw-r--r-- | lib/chef/chef_class.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb index 5cf4f95af5..458ac82467 100644 --- a/lib/chef/chef_class.rb +++ b/lib/chef/chef_class.rb @@ -52,7 +52,14 @@ class Chef # attr_reader :run_context + # Register an event handler with user specified block # + # @return[Chef::EventDispatch::Base] handler object + def event_handler(&block) + dsl = Chef::EventDispatch::DSL.new('Chef client DSL') + dsl.instance_eval(&block) + end + # Get the array of providers associated with a resource_name for the current node # # @param resource_name [Symbol] name of the resource as a symbol |