summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Timberman <joshua@opscode.com>2012-12-10 10:15:25 -0800
committerJoshua Timberman <joshua@opscode.com>2012-12-10 10:15:25 -0800
commit6f6b24736cfa2e24b85dc92b1cbecbb0cff939a3 (patch)
treeab51d5060ad8f8ee8ff60fdef4ffd472101447d2
parentdec8f13775eb6ade75b85c757de0c529f0f1fbff (diff)
parent15acecf1a0440e036ef6f88c7e12f42d9e4335af (diff)
downloadmixlib-shellout-6f6b24736cfa2e24b85dc92b1cbecbb0cff939a3.tar.gz
Merge pull request #11 from Youscribe/cook-1251
[COOK-1251] add initialize to resources
-rw-r--r--resources/package.rb8
-rw-r--r--resources/shortcut.rb8
2 files changed, 16 insertions, 0 deletions
diff --git a/resources/package.rb b/resources/package.rb
index 97c73f1..bf80c57 100644
--- a/resources/package.rb
+++ b/resources/package.rb
@@ -20,6 +20,8 @@
actions :install, :remove
+default_action :install
+
attribute :package_name, :kind_of => String, :name_attribute => true
attribute :source, :kind_of => String, :required => true
attribute :version, :kind_of => String
@@ -35,3 +37,9 @@ attribute :timeout, :kind_of => Integer, :default => 600
# allow target dirtory of installation to be set
#attribute :target_dir
+
+# Covers 0.10.8 and earlier
+def initialize(*args)
+ super
+ @action = :install
+end
diff --git a/resources/shortcut.rb b/resources/shortcut.rb
index 2cf22a3..eb6268b 100644
--- a/resources/shortcut.rb
+++ b/resources/shortcut.rb
@@ -20,8 +20,16 @@
actions :create
+default_action :create
+
attribute :name, :kind_of => String
attribute :target, :kind_of => String
attribute :arguments, :kind_of => String
attribute :description, :kind_of => String
attribute :cwd, :kind_of => String
+
+# Covers 0.10.8 and earlier
+def initialize(*args)
+ super
+ @action = :create
+end