# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 34 def checksum file[:checksum] end
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 59 def compare_to(other) other_value = nil if other.respond_to?(:checksum) other_checksum = other.checksum else begin other_value = other.read rescue Chef::ChefFS::FileSystem::NotFoundError return [ false, nil, :none ] end other_checksum = calc_checksum(other_value) end [ checksum == other_checksum, nil, other_value ] end
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 38 def read begin tmpfile = rest.streaming_request(file[:url]) rescue Timeout::Error => e raise Chef::ChefFS::FileSystem::OperationFailedError.new(:read, self, e), "Timeout reading #{file[:url]}: #{e}" rescue Net::HTTPServerException => e raise Chef::ChefFS::FileSystem::OperationFailedError.new(:read, self, e), "#{e.message} retrieving #{file[:url]}" end begin tmpfile.open tmpfile.read ensure tmpfile.close! end end
Generated with the Darkfish Rdoc Generator 2.