sprout 1.0.1.pre → 1.0.2.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprout might be problematic. Click here for more details.
- data/lib/sprout/remote_file_target.rb +5 -1
- data/lib/sprout/version.rb +1 -1
- data/sprout.gemspec +1 -1
- data/test/unit/remote_file_target_test.rb +10 -1
- metadata +2 -2
@@ -40,7 +40,7 @@ module Sprout
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def load_unpack_or_ignore_archive
|
43
|
-
if(!
|
43
|
+
if(!unpacked_files_exist?)
|
44
44
|
if(!File.exists?(downloaded_file))
|
45
45
|
write_archive download_archive
|
46
46
|
end
|
@@ -48,6 +48,10 @@ module Sprout
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
def unpacked_files_exist?
|
52
|
+
File.exists?(unpacked_file) && !Dir.empty?(unpacked_file)
|
53
|
+
end
|
54
|
+
|
51
55
|
def download_archive
|
52
56
|
Sprout::RemoteFileLoader.load(url, md5, pkg_name)
|
53
57
|
end
|
data/lib/sprout/version.rb
CHANGED
data/sprout.gemspec
CHANGED
@@ -72,13 +72,22 @@ class RemoteFileTargetTest < Test::Unit::TestCase
|
|
72
72
|
|
73
73
|
context "that has already been UNPACKED" do
|
74
74
|
should "not be DOWNLOADED or unpacked" do
|
75
|
-
create_file @unpacked_file
|
75
|
+
create_file File.join(@unpacked_file, 'unpacked')
|
76
76
|
@target.expects(:download_archive).never
|
77
77
|
@target.expects(:unpack_archive).never
|
78
78
|
@target.resolve
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
context "that had an unpacking failure" do
|
83
|
+
should "still unpack the file" do
|
84
|
+
FileUtils.mkdir_p @unpacked_file
|
85
|
+
@target.expects(:download_archive)
|
86
|
+
@target.expects(:unpack_archive)
|
87
|
+
@target.resolve
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
82
91
|
context "that has been DOWNLOADED, but not UNPACKED" do
|
83
92
|
should "unpack but not download" do
|
84
93
|
create_file @downloaded_file
|