ruby-win32/lib/ruby/site_ruby/1.8/rubygems.rb
# Some comments from the ruby-talk list regarding finding the home
# directory:
#
#   I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems
#   to be depending on HOME in those code samples. I propose that
#   it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
#   least on Win32).
#
Some comments from the ruby-talk list regarding finding the home
directory.

I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems
to be depending on HOME in those code samples. I propose that
it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
least on Win32).
Some comments from the ruby - talk list regarding finding the home directory . I have HOME USERPROFILE and HOMEDRIVE + HOMEPATH . Ruby seems to be depending on HOME in those code samples . I propose that it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH ( at least on Win32 ) .
def find_home
      ['HOME', 'USERPROFILE'].each do |homekey|
        return ENV[homekey] if ENV[homekey]
      end
      if ENV['HOMEDRIVE'] && ENV['HOMEPATH']
        return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
      end
      begin
        File.expand_path("~")
      rescue StandardError => ex
        if File::ALT_SEPARATOR
          "C:/"
        else
          "/"
        end
      end
    end
def find_home [ 'HOME' , 'USERPROFILE' ] . each do | homekey | return ENV [ homekey ] if ENV [ homekey ] end if ENV [ 'HOMEDRIVE' ] && ENV [ 'HOMEPATH' ] return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}" end begin File . expand_path ( "~" ) rescue StandardError => ex if File :: ALT_SEPARATOR "C:/" else "/" end end end
Some comments from the ruby-talk list regarding finding the home
directory:
Some comments from the ruby - talk list regarding finding the home directory :