lib/environment.rb in dev_tasks-1.0.29 vs lib/environment.rb in dev_tasks-1.0.30
- old
+ new
@@ -1,21 +1,18 @@
#require 'dev_environment'
class Environment #S< Hash#.class_eval do #< Hash do
- def initialize
- end
-
def self.scm
return "git" if(Dir.exists?(".git"))
- return "svn" if(Dir.exists?(".svn"))
- "none"
+ return "svn" if(Dir.exists?(".svn"))
+ "none"
end
def self.copy src,dest
FileUtils.mkdir_p File.dirname(dest) if !File.exists?(File.dirname(dest))
- FileUtils.cp(src,dest)
+ FileUtils.cp(src,dest)
end
def self.copy_files files,dest
Console.debug("Environment.copy_files([#{files.to_s}],'#{dest}'')")
files.each{|f|
@@ -57,44 +54,10 @@
}
end
"0"
end
- def self.dev_root
- ["DEV_HOME","DEV_ROOT"].each {|v|
- return ENV[v].gsub('\\','/') unless ENV[v].nil?
- }
- dir=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']
- end
-
- machine = `hostname`
- machine = machine.split('.')[0] if machine.include?('.')
- return machine.strip
- end
-
- def self.user
- return ENV['USER'] if !ENV['USER'].nil? #on Unix
- ENV['USERNAME']
- end
-
def self.working_directory
Rake.application.original_dir
end
def self.context
@@ -151,12 +114,12 @@
#puts "rake default (" + directory + ") " + timer.elapsed_str
end
end
end
- def self.execute(cmd)
- timer=Timer.new
- puts "executing " + cmd
- puts `#{cmd}`
- puts timer.elapsed_str
- end
+ # def self.execute(cmd)
+ # timer=Timer.new
+ # puts "executing " + cmd
+# puts `#{cmd}`
+# puts timer.elapsed_str
+# end
end
\ No newline at end of file