lib/env/variables.rb
def home
      # logic adapted from Gem.find_home.
      path = if (env['HOME'] || env['USERPROFILE'])
               env['HOME'] || env['USERPROFILE']
             elsif (env['HOMEDRIVE'] && env['HOMEPATH'])
               "#{env['HOMEDRIVE']}#{env['HOMEPATH']}"
             else
               begin
                 File.expand_path('~')
               rescue
                 if File::ALT_SEPARATOR
                   'C:/'
                 else
                   '/'
                 end
               end
             end

      return Pathname.new(path)
    end
def home
      # logic adapted from Gem.find_home.
      path = if (env['HOME'] || env['USERPROFILE'])
               env['HOME'] || env['USERPROFILE']
             elsif (env['HOMEDRIVE'] && env['HOMEPATH'])
               "#{env['HOMEDRIVE']}#{env['HOMEPATH']}"
             else
               begin
                 File.expand_path('~')
               rescue
                 if File::ALT_SEPARATOR
                   'C:/'
                 else
                   '/'
                 end
               end
             end

      return Pathname.new(path)
    end
The home directory.

 @return [Pathname]
   The path of the home directory.