Class | Chef::Cookbook::Metadata |
In: |
lib/chef/cookbook/metadata/version.rb
lib/chef/cookbook/metadata.rb |
Parent: | Object |
Chef::Cookbook::Metadata provides a convenient DSL for declaring metadata about Chef Cookbooks.
COMPARISON_FIELDS | = | [ :name, :description, :long_description, :maintainer, :maintainer_email, :license, :platforms, :dependencies, :recommendations, :suggestions, :conflicting, :providing, :replacing, :attributes, :groupings, :recipes, :version] |
attributes | [R] | |
conflicting | [R] | |
cookbook | [R] | |
dependencies | [R] | |
groupings | [R] | |
platforms | [R] | |
providing | [R] | |
recipes | [R] | |
recommendations | [R] | |
replacing | [R] | |
suggestions | [R] | |
version | [R] |
Builds a new Chef::Cookbook::Metadata object.
cookbook<String>: | An optional cookbook object |
maintainer<String>: | An optional maintainer |
maintainer_email<String>: | An optional maintainer email |
license<String>::An optional license. Default is Apache v2.0
metadata<Chef::Cookbook::Metadata>
Adds an attribute that a user needs to configure for this cookbook. Takes a name (with the / notation for a nested attribute), followed by any of these options
display_name<String>:: What a UI should show for this attribute description<String>:: A hint as to what this attr is for choice<Array>:: An array of choices to present to the user. calculated<Boolean>:: If true, the default value is calculated by the recipe and cannot be displayed. type<String>:: "string" or "array" - default is "string" ("hash" is supported for backwards compatibility) required<String>:: Whether this attr is 'required', 'recommended' or 'optional' - default 'optional' (true/false values also supported for backwards compatibility) recipes<Array>:: An array of recipes which need this attr set. default<String>,<Array>,<Hash>:: The default value
name<String>: | The name of the attribute (‘foo’, or ‘apache2/log_dir’) |
options<Hash>: | The description of the options |
options<Hash>: | Returns the current options hash |
Sets the current description, or returns it. Should be short - one line only!
description<String>: | The new description |
description<String>: | Returns the description |
Sets the current long description, or returns it. Might come from a README, say.
long_description<String>: | The new long description |
long_description<String>: | Returns the long description |
Sets the cookbooks maintainer, or returns it.
maintainer<String>: | The maintainers name |
maintainer<String>: | Returns the current maintainer. |
Sets the maintainers email address, or returns it.
maintainer_email<String>: | The maintainers email address |
maintainer_email<String>: | Returns the current maintainer email. |
Adds a recipe, definition, or resource provided by this cookbook.
Recipes are specified as normal Definitions are followed by (), and can include :params for prototyping Resources are the stringified version (service[apache2])
recipe, definition, resource<String>: | The thing we provide |
*versions<String>: | A list of versions matching << <= = >= >> followed by a version. |
versions<Array>: | Returns the list of versions for the platform |
Adds a description for a recipe.
recipe<String>: | The recipe |
description<String>: | The description of the recipe |
description<String>: | Returns the current description |