static public Method

Dir.user_home

User home directory lookup adapted from RubyGems.

Source Code

# File rails_generator/lookup.rb, line 25
def Dir.user_home
if ENV['HOME']
  ENV['HOME']
elsif ENV['USERPROFILE']
  ENV['USERPROFILE']
elsif ENV['HOMEDRIVE'] and ENV['HOMEPATH']
  "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
else
  File.expand_path '~'
end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.