class Bundler::CompactIndexClient::CacheFile

def self.write(path, data, digests = nil)

Write data to a temp file, then replace the original file with it verifying the digests if given.
def self.write(path, data, digests = nil)
  return unless data
  new(path) do |file|
    file.digests = digests
    file.write(data)
  end
end