Method: Chef::CookbookSynchronizer#download_file

Defined in:
lib/chef/cookbook/synchronizer.rb

#download_file(url, destination) ⇒ Object

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.



335
336
337
338
339
340
# File 'lib/chef/cookbook/synchronizer.rb', line 335

def download_file(url, destination)
  raw_file = server_api.streaming_request(url)

  Chef::Log.info("Storing updated #{destination} in the cache.")
  cache.move_to(raw_file.path, destination)
end