Class: Total::FreeBSD
- Inherits:
-
Object
- Object
- Total::FreeBSD
- Defined in:
- lib/total/freebsd.rb
Overview
FreeBSD specifics.
Instance Method Summary collapse
-
#memory ⇒ Object
Get the total in bytes.
Instance Method Details
#memory ⇒ Object
Get the total in bytes
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/total/freebsd.rb', line 34 def memory begin `sysctl -a`.split("\n").each do |t| return t.split(' ')[1].to_i if t.start_with?('hw.physmem:') end rescue Errno::ENOENT => e raise CantDetect, e. end raise CantDetect, 'Can\'t detect memory size via sysctl' end |