Class | Chef::Cookbook::Metadata |
In: |
lib/chef/cookbook/metadata.rb
|
Parent: | Object |
Chef::Cookbook::Metadata provides a convenient DSL for declaring metadata about Chef Cookbooks.
NAME | = | 'name'.freeze |
DESCRIPTION | = | 'description'.freeze |
LONG_DESCRIPTION | = | 'long_description'.freeze |
MAINTAINER | = | 'maintainer'.freeze |
MAINTAINER_EMAIL | = | 'maintainer_email'.freeze |
LICENSE | = | 'license'.freeze |
PLATFORMS | = | 'platforms'.freeze |
DEPENDENCIES | = | 'dependencies'.freeze |
RECOMMENDATIONS | = | 'recommendations'.freeze |
SUGGESTIONS | = | 'suggestions'.freeze |
CONFLICTING | = | 'conflicting'.freeze |
PROVIDING | = | 'providing'.freeze |
REPLACING | = | 'replacing'.freeze |
ATTRIBUTES | = | 'attributes'.freeze |
GROUPINGS | = | 'groupings'.freeze |
RECIPES | = | 'recipes'.freeze |
VERSION | = | 'version'.freeze |
COMPARISON_FIELDS | = | [ :name, :description, :long_description, :maintainer, :maintainer_email, :license, :platforms, :dependencies, :recommendations, :suggestions, :conflicting, :providing, :replacing, :attributes, :groupings, :recipes, :version] |
VERSION_CONSTRAINTS | = | {:depends => DEPENDENCIES, :recommends => RECOMMENDATIONS, :suggests => SUGGESTIONS, :conflicts => CONFLICTING, :provides => PROVIDING, :replaces => REPLACING } |
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 )hat 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 |
Adds a conflict for another cookbook, with version checking strings.
cookbook<String>: | The cookbook |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |
Adds a dependency on another cookbook, with version checking strings.
cookbook<String>: | The cookbook |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |
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 |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
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 |
Adds a recommendation for another cookbook, with version checking strings.
cookbook<String>: | The cookbook |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |
Adds a cookbook that is replaced by this one, with version checking strings.
cookbook<String>: | The cookbook we replace |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |
Adds a suggestion for another cookbook, with version checking strings.
cookbook<String>: | The cookbook |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the formx.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |
Adds a supported platform, with version checking strings.
platform<String>,<Symbol>: | The platform (like :ubuntu or :mac_os_x) |
version<String>: | A version constraint of the form "OP VERSION", |
where OP is one of < <= = > >= ~> and VERSION has the form x.y.z or x.y.
versions<Array>: | Returns the list of versions for the platform |