Class: Total::OSX

Inherits:
Object
  • Object
show all
Defined in:
lib/total/osx.rb

Overview

OSX specifics.

Instance Method Summary collapse

Instance Method Details

#memoryObject

Get the total in bytes



34
35
36
37
38
39
# File 'lib/total/osx.rb', line 34

def memory
  `sysctl -a`.split("\n").each do |t|
    return t.split(' ')[1].to_i if t.start_with?('hw.memsize:')
  end
  raise 'Can\'t detect memory size via sysctl'
end