Class: Dflat::Version::Delta
Constant Summary collapse
- DATA_DIR =
'delta'
Class Method Summary collapse
Instance Method Summary collapse
- #add(source, dest, options = {}) ⇒ Object
-
#initialize(path) ⇒ Delta
constructor
A new instance of Delta.
- #remove(list, options = {}) ⇒ Object
Methods inherited from Dir
load, #manifest, #manifest!, #version
Constructor Details
Class Method Details
Instance Method Details
#add(source, dest, options = {}) ⇒ Object
142 143 144 145 146 147 148 149 150 151 |
# File 'lib/dflat/version.rb', line 142 def add source, dest, = {} manifest! f = @redd.add source, dest, 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 = {}) ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/dflat/version.rb', line 153 def remove list, = {} list = [list] if list.instance_of? String @redd.remove list.map { |x| x }, 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 |