lib/store/digest/blob/filesystem.rb
# Remove a blob based on its binary digest value.
# @param bin [String] The binary representation of the keying digest
# @return [File] reutnr
# @raise  [SystemCallError] since it's mucking with the file system
Remove a blob based on its binary digest value.
Remove a blob based on its binary digest value .
def remove_blob bin
    path = path_for bin
    ret  = if path.exist?
             fh = path.open 'rb'
             path.unlink
             fh
           end
    dn = path.dirname.relative_path_from(store).to_s.split ?/
    dn.each_index.reverse_each do |i|
      subpath = store + dn.slice(0..i).join(?/)
      subpath.rmdir if subpath.exist? and subpath.empty?
    end
    ret
  end
def remove_blob bin path = path_for bin ret = if path . exist? fh = path . open 'rb' path . unlink fh end dn = path . dirname . relative_path_from ( store ) . to_s . split ?/ dn . each_index . reverse_each do | i | subpath = store + dn . slice ( 0 .. i ) . join ( ?/ ) subpath . rmdir if subpath . exist? and subpath . empty? end ret end
Remove a blob based on its binary digest value.
Remove a blob based on its binary digest value .
# XXX we should really flock the directory stack # XXX we should really flock the directory stack
None
File
[SystemCallError] since it's mucking with the file system
[ SystemCallError ] since it ' s mucking with the file system
bin
The binary representation of the keying digest
The binary representation of the keying digest