unpack 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/unpack.rb +1 -1
- data/spec/unpack_spec.rb +7 -0
- data/unpack.gemspec +1 -1
- metadata +1 -11
- data/spec/data/to/110_real_.file.rar +0 -1
- data/spec/data/to/120_real_.file.rar +0 -1
- data/spec/data/to/167_real_.file.rar +0 -1
- data/spec/data/to/777_real_.file.rar +0 -1
- data/spec/data/to/918_real_.file.rar +0 -1
data/lib/unpack.rb
CHANGED
@@ -27,7 +27,7 @@ class Unpack
|
|
27
27
|
# Makes shure that every directory structure looks the same
|
28
28
|
@directory = Dir.new(@directory).path rescue nil
|
29
29
|
|
30
|
-
raise Exception.new("You need to specify a valid path") if @directory.nil? or
|
30
|
+
raise Exception.new("You need to specify a valid path") if @directory.nil? or not system("test -r '#{@directory}'")
|
31
31
|
raise Exception.new("You need unzip to keep going") if %x{whereis unzip}.empty?
|
32
32
|
|
33
33
|
@files = []
|
data/spec/unpack_spec.rb
CHANGED
@@ -328,4 +328,11 @@ describe Unpack, "should be able to unpack" do
|
|
328
328
|
it "should contain the right directory when defining a destination path" do
|
329
329
|
Unpack.it!(:file => "spec/data/from/test_package.rar", :to => 'spec/data/to').directory.should match(/spec\/data\/to/)
|
330
330
|
end
|
331
|
+
|
332
|
+
it "should work with folders that contain whitespace" do
|
333
|
+
%x{mkdir -p '/tmp/I Spit on Your Grave[2010][Unrated Edition]DvDrip[Eng]-FXG'}
|
334
|
+
lambda {
|
335
|
+
Unpack.it!(:file => "spec/data/from/test_package.rar", :to => '/tmp/I Spit on Your Grave[2010][Unrated Edition]DvDrip[Eng]-FXG')
|
336
|
+
}.should_not raise_error(Exception)
|
337
|
+
end
|
331
338
|
end
|
data/unpack.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: unpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Linus Oleander
|
@@ -159,11 +159,6 @@ files:
|
|
159
159
|
- spec/data/rar/subdir/483_subtitle_.rar
|
160
160
|
- spec/data/rar/subdir/639_subtitle_.rar
|
161
161
|
- spec/data/rar_real/test_package.rar
|
162
|
-
- spec/data/to/110_real_.file.rar
|
163
|
-
- spec/data/to/120_real_.file.rar
|
164
|
-
- spec/data/to/167_real_.file.rar
|
165
|
-
- spec/data/to/777_real_.file.rar
|
166
|
-
- spec/data/to/918_real_.file.rar
|
167
162
|
- spec/data/zip_real/some_zip_files.zip
|
168
163
|
- spec/spec_helper.rb
|
169
164
|
- spec/unpack_spec.rb
|
@@ -303,11 +298,6 @@ test_files:
|
|
303
298
|
- spec/data/rar/subdir/483_subtitle_.rar
|
304
299
|
- spec/data/rar/subdir/639_subtitle_.rar
|
305
300
|
- spec/data/rar_real/test_package.rar
|
306
|
-
- spec/data/to/110_real_.file.rar
|
307
|
-
- spec/data/to/120_real_.file.rar
|
308
|
-
- spec/data/to/167_real_.file.rar
|
309
|
-
- spec/data/to/777_real_.file.rar
|
310
|
-
- spec/data/to/918_real_.file.rar
|
311
301
|
- spec/data/zip_real/some_zip_files.zip
|
312
302
|
- spec/spec_helper.rb
|
313
303
|
- spec/unpack_spec.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
502
|
@@ -1 +0,0 @@
|
|
1
|
-
54
|
@@ -1 +0,0 @@
|
|
1
|
-
25
|
@@ -1 +0,0 @@
|
|
1
|
-
732
|
@@ -1 +0,0 @@
|
|
1
|
-
522
|