chef
https://github.com/opscode/chef
Ruby
A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
Chef::DSL::DeclareResource#find_resource
Lookup a resource in the resource collection by name. If the resource is not found the will be no exception raised and the call will return nil. If a block is given and no resource is found it will create the resource using the block, if the resource is found then the block will not be applied. The block version is similar to create_if_missing
Edit
git clone [email protected]:opscode/chef.git
cd chef
open lib/chef/dsl/declare_resource.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Chef--DSL--DeclareResource-find_resource-for-pr
# Commit to gitgit add lib/chef/dsl/declare_resource.rbgit commit -m "better docs for Chef::DSL::DeclareResource#find_resource"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Chef--DSL--DeclareResource-find_resource-for-pr
hub pull-request
# Celebrate!