Class: File

Inherits:
Object show all
Defined in:
lib/eymiha.rb

Class Method Summary collapse

Class Method Details

.home_directoryObject

Returns a string containing the user’s home directory.



36
37
38
39
40
41
42
43
44
# File 'lib/eymiha.rb', line 36

def self.home_directory
  home =
    if Config::CONFIG['target_vendor'] == 'pc'
      "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH'].gsub(/\\/,File::SEPARATOR)}"
    else
      ENV['HOME']
    end
  "#{home}#{File::SEPARATOR}"
end