Module: Hardware

Defined in:
brew/Library/Homebrew/hardware.rb,
brew/Library/Homebrew/extend/os/mac/hardware.rb,
brew/Library/Homebrew/extend/os/mac/hardware/cpu.rb,
brew/Library/Homebrew/extend/os/linux/hardware/cpu.rb

Defined Under Namespace

Classes: CPU

Class Method Summary collapse

Class Method Details

.cores_as_wordsObject



126
127
128
129
130
131
132
133
134
135
136
137
# File 'brew/Library/Homebrew/hardware.rb', line 126

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

.generic_oldest_cpuObject



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'brew/Library/Homebrew/hardware.rb', line 156

def oldest_cpu(_version = nil)
  if Hardware::CPU.intel?
    if Hardware::CPU.is_64_bit?
      :core2
    else
      :core
    end
  elsif Hardware::CPU.arm?
    if Hardware::CPU.is_64_bit?
      :armv8
    else
      :armv6
    end
  else
    Hardware::CPU.family
  end
end

.oldest_cpu(version = MacOS.version) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'brew/Library/Homebrew/hardware.rb', line 139

def oldest_cpu(_version = nil)
  if Hardware::CPU.intel?
    if Hardware::CPU.is_64_bit?
      :core2
    else
      :core
    end
  elsif Hardware::CPU.arm?
    if Hardware::CPU.is_64_bit?
      :armv8
    else
      :armv6
    end
  else
    Hardware::CPU.family
  end
end