class Dnatural::Dir
Public Class Methods
mkdir(path, integer=0777, args = {})
click to toggle source
Calls superclass method
# File lib/dnatural.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 'admin' ::Dir.mkdir 'consumer' ::Dir.mkdir 'producer' ::Dir.mkdir 'system' end d end
Public Instance Methods
add(src, dest, options = {})
click to toggle source
# File lib/dnatural.rb, line 29 def add src, dest, options = {} file = FileUtils.cp src, File.join(path, dest), options File.new File.join(path, dest) end
list()
click to toggle source
# File lib/dnatural.rb, line 25 def list glob('**/*') end
remove(list, options = {})
click to toggle source
# File lib/dnatural.rb, line 34 def remove list, options = {} list = [list] if list.instance_of? String FileUtils.rm list.map { |x| File.join(path, x) }, options end