minizip 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -0
- data/lib/minizip/version.rb +1 -1
- data/lib/minizip/zip.rb +4 -3
- metadata +3 -3
data/README.md
CHANGED
@@ -40,6 +40,11 @@ If you want to unzip in a directory:
|
|
40
40
|
|
41
41
|
$ minizip extract zip_name directory_you_want_to_unzip_to
|
42
42
|
|
43
|
+
To force an overwrite of all the files, use the `--overwrite` or `-o` option:
|
44
|
+
|
45
|
+
$ minizip extract zip_name directory_you_want_to_unzip_to --overwrite
|
46
|
+
$ minizip extract zip_name directory_you_want_to_unzip_to -o
|
47
|
+
|
43
48
|
## CONTRIBUTING
|
44
49
|
|
45
50
|
All push requests are welcome provided they are properly tested(at least for Unix). We are still trying to fix the tests for Windows(some help here would be great also). We use Aruba for testing.
|
data/lib/minizip/version.rb
CHANGED
data/lib/minizip/zip.rb
CHANGED
@@ -30,18 +30,19 @@ module Minizip
|
|
30
30
|
options = {'directory' => options}
|
31
31
|
end
|
32
32
|
directory = options['directory']
|
33
|
-
overwrite = options['overwrite'] ? '-o' : nil
|
34
33
|
|
35
34
|
if File.exists?(zip_name)
|
36
35
|
Dir.mkdir(directory) if directory && !File.exists?(directory)
|
37
36
|
|
38
37
|
if USING_WINDOWS
|
38
|
+
overwrite = options['overwrite'] ? '-y' : nil
|
39
39
|
if directory
|
40
|
-
system "7za x #{zip_name} -o#{directory}"
|
40
|
+
system "7za x #{zip_name} -o#{directory} #{overwrite}"
|
41
41
|
else
|
42
|
-
system "7za x #{zip_name}"
|
42
|
+
system "7za x #{zip_name} #{overwrite}"
|
43
43
|
end
|
44
44
|
else
|
45
|
+
overwrite = options['overwrite'] ? '-o' : nil
|
45
46
|
if directory
|
46
47
|
system "unzip #{overwrite} #{zip_name} -d #{directory}"
|
47
48
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minizip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Radamanthus Batnag and Eumir Gaspar
|