class Dflat::Version::Delta

Constants

DATA_DIR

Public Class Methods

mkdir(path, integer = 0777, args = {}) click to toggle source
Calls superclass method
# File lib/dflat/version.rb, line 130
def self.mkdir path, integer = 0777, args = {}
  super path, integer
  d = Delta.new path
  @redd = ReDD::Dir.mkdir File.join(d.path, DATA_DIR)
  d
end
new(path) click to toggle source
Calls superclass method
# File lib/dflat/version.rb, line 137
def initialize path
  super path
  @redd = ReDD::Dir.new File.join(path, DATA_DIR)
end

Public Instance Methods

add(source, dest, options = {}) click to toggle source
# File lib/dflat/version.rb, line 142
def add source, dest, options = {}
  manifest!
  f = @redd.add source, dest, options
  m = manifest.add dest, :base => File.join(data_path, 'add')
  File.open(File.join(path, 'manifest.txt'), 'w') do |f|
    f.write(m.to_s)
  end
  
  f
end
remove(list, options = {}) click to toggle source
# File lib/dflat/version.rb, line 153
def remove list, options = {}
  list = [list] if list.instance_of? String
  @redd.remove list.map { |x| x }, options
  m = manifest!
  list.each do |l|
    m = m.remove l
  end

  File.open(File.join(path, 'manifest.txt'), 'w') do |f|
    f.write(m.to_s)
  end
end

Private Instance Methods

data_path() click to toggle source
# File lib/dflat/version.rb, line 167
def data_path
  File.join(self.path, DATA_DIR)
end
dmanifest_path() click to toggle source
# File lib/dflat/version.rb, line 170
def dmanifest_path
  File.join(path, 'd-manifest.txt')
end
manifest_path() click to toggle source
# File lib/dflat/version.rb, line 173
def manifest_path
  File.join(path, 'manifest.txt')
end