class ReDD::Dir

Public Class Methods

mkdir(path, integer=0777, args = {}) click to toggle source
Calls superclass method
# File lib/redd.rb, line 10
def self.mkdir path, integer=0777, args = {}
  super path, integer
  d = Dir.new path
  d.type = Dnatural::VERSION

  ::Dir.chdir(d.path)  do
    ::Dir.mkdir 'add'
    FileUtils.touch 'delete.txt'
  end
  d
end

Public Instance Methods

add(src, dest, options = {}) click to toggle source
# File lib/redd.rb, line 26
def add src, dest, options = {}
  FileUtils.mkdir_p File.dirname(File.join(path, 'add', dest))
  file = FileUtils.cp src, File.join(path, 'add', dest), options
  File.new File.join(path, 'add', dest)
end
list() click to toggle source
# File lib/redd.rb, line 22
def list
  NoMethodError
end
remove(list, options = {}) click to toggle source
# File lib/redd.rb, line 32
def remove list, options = {}
  list = [list] if list.instance_of? String
  File.open(File.join(path, 'delete.txt'), 'w') do |f|
    f.write list.join("\n")
  end
end