Module: OSwitch::OS
- Included in:
- OSwitch
- Defined in:
- lib/oswitch/os.rb,
lib/oswitch/os/linux.rb,
lib/oswitch/os/darwin.rb
Overview
Get OS specific info. Like, what directories to mount in the container, current user, home directory.
This module first defines methods common to Linux and Darwin, then does OS detection and loads OS specific code.
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#cwd ⇒ Object
20 21 22 |
# File 'lib/oswitch/os.rb', line 20 def cwd Dir.pwd end |
#home ⇒ Object
12 13 14 |
# File 'lib/oswitch/os.rb', line 12 def home ENV['HOME'] end |
#shell ⇒ Object
16 17 18 |
# File 'lib/oswitch/os.rb', line 16 def shell File.basename ENV['SHELL'] end |
#username ⇒ Object
8 9 10 |
# File 'lib/oswitch/os.rb', line 8 def username ENV['USER'] end |