diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-04-27 22:44:28 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-04-27 22:44:28 -0700 |
commit | bab9b3459fe41849970e50cb9b96ea62370fbad0 (patch) | |
tree | c685354e2798bf08905dca308f9c58a52b94e33a /lib/chef/resource.rb | |
parent | 39c0a0994cb5af59e4fbb9fefbc487f6bc21d2fb (diff) | |
download | chef-bab9b3459fe41849970e50cb9b96ea62370fbad0.tar.gz |
chef compiles
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index fab6279a0e..5a5263b321 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -18,16 +18,18 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # +require File.join(File.dirname(__FILE__), "mixin", "params_validate") require File.join(File.dirname(__FILE__), "mixin", "check_helper") require 'yaml' class Chef class Resource - + include Chef::Mixin::CheckHelper + include Chef::Mixin::ParamsValidate - attr_accessor :tag, :actions, :params - attr_reader :name, :noop, :resource_name, :collection, :notifies, :subscribes + attr_accessor :tag, :actions, :params, :provider, :updated, :allowed_actions + attr_reader :resource_name, :collection def initialize(name, collection=nil) @name = name @@ -41,6 +43,28 @@ class Chef @before = nil @actions = Hash.new @params = Hash.new + @provider = nil + @allowed_actions = [ :nothing ] + @action = :nothing + @updated = false + end + + def action(arg=nil) + if arg != nil + arg = arg.to_sym + end + set_or_return( + @action, + arg, + { + :action => arg, + }, + { + :action => { + :equal_to => @allowed_actions, + } + } + ) end def name(name=nil) |