Class: ZipDir::Zipper::Proxy
- Inherits:
-
Object
- Object
- ZipDir::Zipper::Proxy
- Defined in:
- lib/zip_dir/zipper.rb
Instance Method Summary collapse
- #add_path(source_path, root_directory: false) ⇒ Object (also: #<<)
-
#initialize(copy_path) ⇒ Proxy
constructor
A new instance of Proxy.
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 |