Class: TTY::Terminal::Home
- Inherits:
-
Object
- Object
- TTY::Terminal::Home
- Defined in:
- lib/tty/terminal/home.rb
Overview
A class responsible for locating user home
Instance Method Summary collapse
-
#home ⇒ Object
Find user home.
Instance Method Details
#home ⇒ Object
Find user home
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tty/terminal/home.rb', line 10 def home if (env_home = ENV['HOME']) env_home else begin require 'etc' File.("~#{Etc.getlogin}") rescue TTY::System.windows? ? 'C:/' : '/' end end end |