Class: ZipDir::Zipper::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/zip_dir/zipper.rb

Instance Method Summary collapse

Constructor Details

#initialize(copy_path) ⇒ Proxy

Returns a new instance of Proxy.



46
47
48
# File 'lib/zip_dir/zipper.rb', line 46

def initialize(copy_path)
  @copy_path = copy_path
end

Instance Method Details

#add_path(source_path, root_directory: false) ⇒ Object Also known as: <<



50
51
52
53
54
55
56
# File 'lib/zip_dir/zipper.rb', line 50

def add_path(source_path, root_directory: false)
  if root_directory
    Dir.glob("#{source_path}/*").each { |path| add_path(path) }
  else
    FileUtils.cp_r source_path, @copy_path
  end
end