lib/dev/Environment.rb in dev-1.0.77 vs lib/dev/Environment.rb in dev-1.0.78
- old
+ new
@@ -58,9 +58,24 @@
end
end
hash
end
+ def self.user
+ user = ENV['USER'] if !ENV['USER'].nil? #on Unix
+ user = ENV['USERNAME'] if !ENV['USERNAME'].nil? #on Windows
+ end
+
+ def self.machine
+ if !ENV['COMPUTERNAME'].nil?
+ return ENV['COMPUTERNAME']
+ end
+
+ machine = nil
+ machine = `hostname` if machine.nil?
+ machine = machine.split('.')[0] if machine.include?('.')
+ end
+
end
end # module Dev