lib/environment.rb in dev_tasks-1.0.27 vs lib/environment.rb in dev_tasks-1.0.28
- old
+ new
@@ -57,18 +57,25 @@
end
"0"
end
def self.dev_root
- ["DEV_HOME","DEV_ROOT","USERPROFILE","HOME"].each {|v|
- return ENV[v].gsub('\\','/') unless ENV[v].nil?
- }
- dir="~"
- dir=ENV["HOME"] unless ENV["HOME"].nil?
- dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
- dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil?
-
+ ["DEV_HOME","DEV_ROOT"].each {|v|
+ return ENV[v].gsub('\\','/') unless ENV[v].nil?
+ }
+ dir=self.home
+ dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil?
return dir
+ end
+
+ def self.home
+ ["USERPROFILE","HOME"].each {|v|
+ return ENV[v].gsub('\\','/') unless ENV[v].nil?
+ }
+ dir="~"
+ dir=ENV["HOME"] unless ENV["HOME"].nil?
+ dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
+ return dir
end
def self.machine
if !ENV['COMPUTERNAME'].nil?
return ENV['COMPUTERNAME']
\ No newline at end of file