cookbook 'updatable-attributes', '= 1.0.2'
updatable-attributes (8) Versions 1.0.2 Follow1
Allow definition of attribute based on other attributes and recomputed on update.
cookbook 'updatable-attributes', '= 1.0.2', :supermarket
knife supermarket install updatable-attributes
knife supermarket download updatable-attributes
Cookbook updatable-attributes
Allow to declare attributes computed each time other ones are updated.
Requirements
This cookbook supports and requires Chef 12.16.23+.
Platforms
This cookbook leverage built-in Chef features and supports all Platforms.
Usage
To compute attributes based on a single attribute path:
on_attribute_update('foo', 'bar') do default['blah'] = node['foo']['bar'] end # equivalent to on_attribute_update(%w[foo bar]) do default['blah'] = node['foo']['bar'] end
To compute attributes based on multiple attribute paths:
on_attributes_update(%w[foo bar], 'blah') do default['all'] = node['foo']['bar'] + node['blah'] end # equivalent to on_attributes_update(%w[foo bar], %w[blah]) do default['all'] = node['foo']['bar'] + node['blah'] end
Options
Option | Default | Description |
---|---|---|
init_on_registration | true |
Evaluate the block on registration. |
observe_\parents | true |
Also observe parent attribute updates. |
recursion | 0 |
Configure allowed level of recursion. |
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
- Authors Baptiste Courtois (b.courtois@criteo.com)
Copyright 2017 Baptiste Courtois Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
Collaborator Number Metric
1.0.2 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 passed this metric
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 failed this metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 passed this metric
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 passed this metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 failed this metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number