module MachineGun::OS

Public Class Methods

arch() click to toggle source
# File lib/machine-gun/os.rb, line 21
def arch
  platform.split('-')[0]
end
host() click to toggle source
# File lib/machine-gun/os.rb, line 8
def host
  h = platform.split('-')[1]

  case
  when h =~ /darwin/
    'darwin'
  when h =~ /linux/
    'linux'
  else
    'unknown'
  end
end
linux?() click to toggle source
# File lib/machine-gun/os.rb, line 29
def linux?
  host =~ /linux/i
end
mac?() click to toggle source
# File lib/machine-gun/os.rb, line 25
def mac?
  host =~ /darwin/i
end
platform() click to toggle source
# File lib/machine-gun/os.rb, line 4
def platform
  RUBY_PLATFORM
end