README.md in zip_dir-0.1.0 vs README.md in zip_dir-0.1.1
- old
+ new
@@ -19,17 +19,35 @@
$ gem install zip_dir
## Usage
```ruby
+#
# Zip
-zipper = ZipDir::Zipper.new
+#
+zipper = ZipDir::Zipper.new(__optional_filename__)
+
+zip_file = zipper.generate(__some_path_to_directory__)
+zip_file # => #<Tempfile:/var/folders/6c/s4snqy051jqdpbjw7f7tsn940000gn/T/zipper-20151127-19694-1baaqoi.zip>
+zip_file == zipper.file # => true
+
+# to zip multiple directories
zip_file = zipper.generate do |z|
z.add_path __some_path_to_directory__
z.add_path __another_path_to_directory__ # does a shell "cp -r" operation
end
-zip_file == zipper.file # => true
+# to zip __just the paths inside the directory___
+zip_file = zipper.generate(__some_path_to_directory__, root_directory: true)
+zip_file = zipper.generate do |z|
+ z.add_path __some_path_to_directory__, root_directory: true
+end
+
+#
# Unzip
+#
unzip_path = ZipDir::Unzipper.new(zip_file.path).unzip_path
```
+
+## dir_model
+Use [`dir_model`](https://github.com/FinalCAD/dir_model) to create complex directories to zip.
\ No newline at end of file