Parent

Class/Module Index [+]

Quicksearch

Chef::Checksum::Storage::Filesystem

Public Class Methods

new(base_dir, checksum) click to toggle source
# File lib/chef/checksum/storage/filesystem.rb, line 22
def initialize(base_dir, checksum)
  @base_dir = base_dir
  @checksum = checksum
end

Public Instance Methods

checksum_repo_directory() click to toggle source
# File lib/chef/checksum/storage/filesystem.rb, line 32
def checksum_repo_directory
  File.join(Chef::Config.checksum_path, @checksum[0..1])
end
commit(sandbox_file) click to toggle source
# File lib/chef/checksum/storage/filesystem.rb, line 36
def commit(sandbox_file)
  FileUtils.mkdir_p(checksum_repo_directory)
  File.rename(sandbox_file, file_location)
end
file_location() click to toggle source
# File lib/chef/checksum/storage/filesystem.rb, line 27
def file_location
  File.join(checksum_repo_directory, @checksum)
end
Also aliased as: to_s
purge() click to toggle source

Deletes the file backing this checksum from the on-disk repo. Purging the checksums is how users can get back to a valid state if they've deleted files, so we silently swallow Errno::ENOENT here.

# File lib/chef/checksum/storage/filesystem.rb, line 48
def purge
  FileUtils.rm(file_location)
rescue Errno::ENOENT
  true
end
revert(original_committed_file_location) click to toggle source
# File lib/chef/checksum/storage/filesystem.rb, line 41
def revert(original_committed_file_location)
  File.rename(file_location, original_committed_file_location)
end
to_s() click to toggle source
Alias for: file_location

[Validate]

Generated with the Darkfish Rdoc Generator 2.