Module: OSwitch::Darwin

Defined in:
lib/oswitch.rb

Overview

Mac OS X specific code.

Constant Summary collapse

BLACKLIST =
%r{
^/$|
^/(bin|cores|dev|etc|home|Incompatible\ Software|
   installer\.failurerequests|lost\+found|net|
   Network|opt|private|sbin|System|Users|tmp|
   usr|var|Volumes$)
}x

Instance Method Summary collapse

Instance Method Details

#gidObject



118
119
120
# File 'lib/oswitch.rb', line 118

def gid
  `boot2docker ssh id -g`.chomp
end

#mountpointsObject



122
123
124
125
126
127
# File 'lib/oswitch.rb', line 122

def mountpoints
  volumes = Dir['/Volumes/*'].map {|v| File.symlink?(v) ? File.readlink(v) : v}
  volumes = volumes | Dir['/*']
  volumes.reject! { |mount| mount =~ BLACKLIST }
  volumes << home
end

#uidObject



114
115
116
# File 'lib/oswitch.rb', line 114

def uid
  `boot2docker ssh id -u`.chomp
end