sprout 1.0.0.pre → 1.0.1.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.

@@ -30,12 +30,19 @@ module Sprout::System
30
30
 
31
31
  def win_nix_home
32
32
  path = win_home.split('\\').join("/")
33
- path = path.split(":").join("")
33
+ return path if File.exists?(path)
34
+
34
35
  parts = path.split("/")
35
36
  path = parts.shift().downcase + "/" + parts.join("/")
37
+ path = path.split(":").join("")
36
38
  "/cygdrive/" + path
37
39
  end
38
40
 
41
+ private
42
+
43
+ def mingw_home_exists? path
44
+ File.exists?(path)
45
+ end
39
46
  end
40
47
  end
41
48
 
@@ -6,7 +6,7 @@ module Sprout
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 0
9
- TINY = 0
9
+ TINY = 1
10
10
  RELEASE = 'pre'
11
11
 
12
12
  STRING = [MAJOR, MINOR, TINY, RELEASE].join('.')
@@ -6,20 +6,26 @@ class WinNixSystemTest < Test::Unit::TestCase
6
6
  context "new windows nix (cygwin/mingw) system" do
7
7
 
8
8
  setup do
9
- @user = Sprout::System::WinNixSystem.new
10
- @user.stubs(:win_home).returns 'C:\Documents and Settings\Some System'
9
+ @sys = Sprout::System::WinNixSystem.new
10
+ @sys.stubs(:win_home).returns 'C:\Documents and Settings\Some System'
11
11
  end
12
12
 
13
- should "find home" do
14
- assert_equal '/cygdrive/c/Documents and Settings/Some System', @user.home
13
+ should "find home on cygwin" do
14
+ File.stubs(:exists?).returns false
15
+ assert_equal '/cygdrive/c/Documents and Settings/Some System', @sys.home
16
+ end
17
+
18
+ should "find home on mingw" do
19
+ File.stubs(:exists?).returns true
20
+ assert_equal 'C:/Documents and Settings/Some System', @sys.home
15
21
  end
16
22
 
17
23
  should "wrap paths that have spaces with escaped quotes" do
18
- assert_equal "\'foo bar\'", @user.clean_path("foo bar")
24
+ assert_equal "\'foo bar\'", @sys.clean_path("foo bar")
19
25
  end
20
26
 
21
27
  should "not modify paths that have no spaced" do
22
- assert_equal "foobar", @user.clean_path("foobar")
28
+ assert_equal "foobar", @sys.clean_path("foobar")
23
29
  end
24
30
  end
25
31
  end
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
8
+ - 1
9
9
  - pre
10
- version: 1.0.0.pre
10
+ version: 1.0.1.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes