Class: Furoshiki::Zip::DirectoryContents
- Inherits:
-
Object
- Object
- Furoshiki::Zip::DirectoryContents
- Defined in:
- lib/furoshiki/zip/directory_contents.rb
Instance Method Summary collapse
-
#initialize(input_dir, output_file) ⇒ DirectoryContents
constructor
A new instance of DirectoryContents.
-
#write ⇒ Object
Zip the contents of the input directory, without the root.
Constructor Details
#initialize(input_dir, output_file) ⇒ DirectoryContents
Returns a new instance of DirectoryContents.
8 9 10 11 |
# File 'lib/furoshiki/zip/directory_contents.rb', line 8 def initialize(input_dir, output_file) @input_dir = Pathname.new(input_dir) @zip = Recursive.new(output_file) end |
Instance Method Details
#write ⇒ Object
Zip the contents of the input directory, without the root.
14 15 16 17 |
# File 'lib/furoshiki/zip/directory_contents.rb', line 14 def write entries = @input_dir.children(false) @zip.write entries, @input_dir, '' end |