Java has the convienient System.getProperty(\"user.home\") to get the user\'s \"home\" directory in a platform-independent way. What\'s the equivalent in Ruby? I
System.getProperty(\"user.home\")
ENV["HOME"] or ENV["HOMEPATH"] should give you what you want.
ENV["HOME"]
ENV["HOMEPATH"]
homes = ["HOME", "HOMEPATH"] realHome = homes.detect {|h| ENV[h] != nil} if not realHome puts "Could not find home directory" end