# File lib/facter/processors/os.rb, line 146 def initialize require "cfpropertylist" @system_hardware_data = query_system_profiler end
# File lib/facter/processors/os.rb, line 151 def get_processor_count Facter::Util::POSIX.sysctl("hw.ncpu").to_i end
# File lib/facter/processors/os.rb, line 155 def get_processor_speed @system_hardware_data["current_processor_speed"] end
# File lib/facter/processors/os.rb, line 161 def query_system_profiler output = Facter::Core::Execution.exec("/usr/sbin/system_profiler -xml SPHardwareDataType 2>/dev/null") plist = CFPropertyList::List.new plist.load_str(output) parsed_xml = CFPropertyList.native_types(plist.value) parsed_xml[0]['_items'][0] end