Method: Berkshelf::Berksfile#install

Defined in:
lib/berkshelf/berksfile.rb

#installArray<CachedCookbook>

Install the dependencies listed in the Berksfile, respecting the locked versions in the Berksfile.lock.

  1. Check that a lockfile exists. If a lockfile does not exist, all dependencies are considered to be “unlocked”. If a lockfile is specified, a definition is created via the following algorithm:

    • For each source, see if there exists a locked version that still satisfies the version constraint in the Berksfile. If there exists such a source, remove it from the list of unlocked sources. If not, then either a version constraint has changed, or a new source has been added to the Berksfile. In the event that a locked_source exists, but it no longer satisfies the constraint, this method will raise a OutdatedCookbookSource, and inform the user to run berks update COOKBOOK to remedy the issue.

    • Remove any locked sources that no longer exist in the Berksfile (i.e. a cookbook source was removed from the Berksfile).

  2. Resolve the collection of locked and unlocked dependencies.

  3. Write out a new lockfile.

Returns:

Raises:

  • (OutdatedDependency)

    if the lockfile constraints do not satisfy the Berksfile constraints



404
405
406
# File 'lib/berkshelf/berksfile.rb', line 404

def install
  Installer.new(self).run
end