chef

https://github.com/opscode/chef

Ruby

A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

Chef::Resource#should_skip?

Evaluates not_if and only_if conditionals. Returns a falsey value if any
of the conditionals indicate that this resource should be skipped, i.e.,
if an only_if evaluates to false or a not_if evaluates to true.

If this resource should be skipped, returns the first conditional that
"fails" its check. Subsequent conditionals are not evaluated, so in
general it's not a good idea to rely on side effects from not_if or
only_if commands/blocks being evaluated.

Also skips conditional checking when the action is :nothing

Source | Google | Stack overflow

Edit

git clone [email protected]:opscode/chef.git

cd chef

open lib/chef/resource.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chef--Resource-should_skip--for-pr


# Commit to git

git add lib/chef/resource.rbgit commit -m "better docs for Chef::Resource#should_skip?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chef--Resource-should_skip--for-pr

hub pull-request


# Celebrate!