Module: Hardware
- Extended by:
- T::Sig
- Defined in:
- extend/os/mac/hardware.rb,
extend/os/mac/hardware/cpu.rb,
extend/os/linux/hardware/cpu.rb,
hardware.rb
Overview
Helper module for querying hardware information.
Defined Under Namespace
Classes: CPU
Class Method Summary collapse
-
.cores_as_words ⇒ Object
-
.oldest_cpu(_version = nil) ⇒ Symbol
(also: generic_oldest_cpu)
Class Method Details
.cores_as_words ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'hardware.rb', line 181 def cores_as_words case Hardware::CPU.cores when 1 then "single" when 2 then "dual" when 4 then "quad" when 6 then "hexa" when 8 then "octa" when 12 then "dodeca" else Hardware::CPU.cores end end |
.oldest_cpu(_version = nil) ⇒ Symbol Also known as: generic_oldest_cpu
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'extend/os/mac/hardware.rb', line 7 def self.oldest_cpu(version = nil) version = if version MacOS::Version.new(version.to_s) else MacOS.version end if CPU.arch == :arm64 :arm_vortex_tempest # TODO: this cannot be re-enabled until either Rosetta 2 supports AVX # instructions in bottles or Homebrew refuses to run under Rosetta 2 (when # ARM support is sufficiently complete): # https://github.com/Homebrew/homebrew-core/issues/67713 # # elsif version >= :big_sur # :ivybridge elsif version >= :mojave :nehalem else generic_oldest_cpu end end |