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

Modules: Darwin, Linux

Instance Method Summary collapse

Instance Method Details

#cwdObject



20
21
22
# File 'lib/oswitch/os.rb', line 20

def cwd
  Dir.pwd
end

#homeObject



12
13
14
# File 'lib/oswitch/os.rb', line 12

def home
  ENV['HOME']
end

#shellObject



16
17
18
# File 'lib/oswitch/os.rb', line 16

def shell
  File.basename ENV['SHELL']
end

#usernameObject



8
9
10
# File 'lib/oswitch/os.rb', line 8

def username
  ENV['USER']
end