Class | Chef::CookbookSynchronizer
In: | lib/chef/cookbook/synchronizer.rb
Parent: | Object

Synchronizes the locally cached copies of cookbooks with the files on the server.

### Methods

cache cached_copy_up_to_date? clear_obsoleted_cookbooks cookbook_count cookbook_names cookbooks download_file have_cookbook? mark_cached_file_valid new server_api sync_cookbook sync_cookbooks sync_file_in_cookbook

### Constants

EAGER_SEGMENTS | = | Chef::CookbookVersion::COOKBOOK_SEGMENTS.dup

### Public Class methods

new(cookbooks_by_name, events)

### Public Instance methods

cache()
cached_copy_up_to_date?(local_path, expected_checksum)
clear_obsoleted_cookbooks()

Iterates over cached cookbooks’ files, removing files belonging to cookbooks that don‘t appear in `cookbook_hash`

cookbook_count()
cookbook_names()
cookbooks()
download_file(url, destination)

Unconditionally download the file from the given URL. File will be downloaded to the path `destination` which is relative to the Chef file cache root.

have_cookbook?(cookbook_name)
mark_cached_file_valid(cache_filename)

Marks the given file as valid (non-stale).

server_api()
sync_cookbook(cookbook)

Sync the eagerly loaded files contained by `cookbook`

### Arguments

cookbook<Chef::Cookbook>: | The cookbook to update
valid_cache_entries<Hash>: | Out-param; Added to this hash are the files that

were referred to by this cookbook

sync_cookbooks()

     Synchronizes all the cookbooks from the chef-server.

)

     === Returns
     true:: Always returns true

sync_file_in_cookbook(cookbook, file_manifest)

Sync an individual file if needed. If there is an up to date copy locally, nothing is done.

### Arguments

file_manifest:: | A Hash of the form {"path" => ‘relative/path’, "url" => "location to fetch the file"}

### Returns

Path to the cached file as a String

[Validate]