diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-10-02 09:03:22 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-10-02 09:03:22 -0700 |
commit | 5caef70b1307d7d099c2621dc9ff7a4c0b3268d6 (patch) | |
tree | 2a6ca8e9cf5be68798f00197870d10b132dcf34f /lib/chef/resource.rb | |
parent | 6257a566101870a5734edae03197c5b32b953773 (diff) | |
download | chef-5caef70b1307d7d099c2621dc9ff7a4c0b3268d6.tar.gz |
Supporting multiple actions
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index de10d44e88..866b77dc14 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -49,12 +49,22 @@ class Chef end def action(arg=nil) - arg = arg.to_sym if arg - set_or_return( - :action, - arg, - :equal_to => @allowed_actions - ) + if arg + action_list = arg.kind_of?(Array) ? arg : [ arg ] + action_list.each do |action| + validate( + { + :action => action, + }, + { + :object => { :equal_to => @allowed_actions }, + } + ) + end + @action = action_list + else + @action + end end def name(name=nil) |