summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_version.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-08-05 13:28:43 -0700
committerdanielsdeleo <dan@getchef.com>2014-08-12 11:03:09 -0700
commitf5ea885549b840cbb9008f739d1f6f1784e06f97 (patch)
tree2ba9660390029cd6beadc1e79707c59e411c2b41 /lib/chef/cookbook_version.rb
parent98967ebcf02fa3a85f63a532ca5a43ce70dcfe6a (diff)
downloadchef-f5ea885549b840cbb9008f739d1f6f1784e06f97.tar.gz
Respect metadata name attribute
Fixes CHEF-3307
Diffstat (limited to 'lib/chef/cookbook_version.rb')
-rw-r--r--lib/chef/cookbook_version.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 4482f778c1..76e6d152b2 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -51,10 +51,14 @@ class Chef
attr_accessor :provider_filenames
attr_accessor :root_filenames
attr_accessor :name
- attr_accessor :metadata
attr_accessor :metadata_filenames
attr_accessor :status
+ # A Chef::Cookbook::Metadata object. It has a setter that fixes up the
+ # metadata to add descriptions of the recipes contained in this
+ # CookbookVersion.
+ attr_reader :metadata
+
# attribute_filenames also has a setter that has non-default
# functionality.
attr_reader :attribute_filenames
@@ -195,6 +199,12 @@ class Chef
attribute_filenames
end
+ def metadata=(metadata)
+ @metadata = metadata
+ @metadata.recipes_from_cookbook_version(self)
+ @metadata
+ end
+
## BACKCOMPAT/DEPRECATED - Remove these and fix breakage before release [DAN - 5/20/2010]##
alias :attribute_files :attribute_filenames
alias :attribute_files= :attribute_filenames=