lib/user.rb in sprout-0.5.13 vs lib/user.rb in sprout-0.5.15
- old
+ new
@@ -79,10 +79,11 @@
#############################
# UnixUser class
class UnixUser
def initialize
+ require 'open3'
@home = nil
end
def home=(path)
@home = path
@@ -189,10 +190,15 @@
class WinUser < UnixUser
@@LOCAL_SETTINGS = "Local\ Settings"
@@APPLICATION_DATA = "Application\ Data"
+ def initialize
+ require 'win32/open3'
+ @home = nil
+ end
+
def home
usr = super
if(usr.index "My Documents")
usr = File.dirname(usr)
end
@@ -221,15 +227,22 @@
return name.capitalize
end
end
class CygwinUser < WinUser
+
+ def initialize
+ require 'open3'
+ @home = nil
+ end
+
def clean_path(path)
if(path.index(' '))
return %{'#{path}'}
end
return path
end
+
end
class VistaUser < WinUser
def home
profile = ENV['USERPROFILE']