Module | Chef::CookbookVersionSelector
In: | lib/chef/cookbook_version_selector.rb

### Methods

constrain create_dependency_graph_from_cookbooks expand_to_cookbook_versions filter_dep_selector_message

### Public Class methods

constrain(all_cookbooks, recipe_constraints)

Return a hash mapping cookbook names to a CookbookVersion object. If there is no solution that satisfies the constraints, the first run list item that caused unsatisfiability is returned.

This is the final version-resolved list of cookbooks for the RunList.

all_cookbooks - a hash mapping cookbook names to an array of available CookbookVersions.

recipe_constraints - an array of hashes describing the expanded run list. Each element is a hash containing keys :name and :version_constraint. The :name component is either the fully-qualified recipe name (e.g. "cookbook1::non_default_recipe") or just a cookbook name, indicating the default recipe is to be run (e.g. "cookbook1").

create_dependency_graph_from_cookbooks(all_cookbooks)

all_cookbooks - a hash mapping cookbook names to an array of available CookbookVersions.

Creates a DependencyGraph from CookbookVersion objects

expand_to_cookbook_versions(run_list, environment, couchdb=nil)

Expands the run_list, constrained to the environment‘s CookbookVersion constraints.

Returns:

      Hash of: name to CookbookVersion

filter_dep_selector_message(message)

This method replaces verbiage from DepSelector messages with Chef-domain-specific verbiage, such as replacing package with cookbook.

TODO [cw, 2011/2/25]: this is a near-term hack. In the long run, we‘ll do this better.

[Validate]