Module: Platform::OS::OSX::SystemProfiler

Defined in:
lib/Platform/OS/OSX/SystemProfiler.rb

Class Method Summary collapse

Class Method Details

.major_system_versionObject



21
22
23
# File 'lib/Platform/OS/OSX/SystemProfiler.rb', line 21

def major_system_version
  system_version.split('.').first.to_i
end

.minor_system_versionObject



25
26
27
# File 'lib/Platform/OS/OSX/SystemProfiler.rb', line 25

def minor_system_version
  system_version.split('.').second.to_i
end

.system_versionObject



17
18
19
# File 'lib/Platform/OS/OSX/SystemProfiler.rb', line 17

def system_version
  `system_profiler SPSoftwareDataType`.force_encoding('UTF-8').grep(/System Version/).split(': ').second.split.fourth
end

.tiny_system_versionObject



29
30
31
# File 'lib/Platform/OS/OSX/SystemProfiler.rb', line 29

def tiny_system_version
  system_version.split('.').third.to_i
end