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.

@@ -40,7 +40,7 @@ module Sprout
40
40
  end
41
41
 
42
42
  def load_unpack_or_ignore_archive
43
- if(!File.exists?(unpacked_file))
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
@@ -6,7 +6,7 @@ module Sprout
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 0
9
- TINY = 1
9
+ TINY = 2
10
10
  RELEASE = 'pre'
11
11
 
12
12
  STRING = [MAJOR, MINOR, TINY, RELEASE].join('.')
data/sprout.gemspec CHANGED
@@ -7,7 +7,7 @@ require 'rake'
7
7
  require 'sprout/version'
8
8
 
9
9
  Gem::Specification.new do |s|
10
- s.name = 'sprout'
10
+ s.name = Sprout::NAME
11
11
  s.version = Sprout::VERSION::STRING
12
12
  s.platform = Gem::Platform::RUBY
13
13
  s.authors = ["Luke Bayes"]
@@ -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
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - pre
10
- version: 1.0.1.pre
10
+ version: 1.0.2.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes