diff options
| author | Sebastian Staudt | 2016-05-09 09:41:30 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2016-05-09 08:41:30 +0100 |
| commit | 57bf33302a6e4765be8b7dd4c05e15394a9cf31d (patch) | |
| tree | cb8ff224e02da33236426d28c847ec805095157e /Library | |
| parent | a558629654c28fff1ccfb8e9895485e0da79e167 (diff) | |
| download | brew-57bf33302a6e4765be8b7dd4c05e15394a9cf31d.tar.bz2 | |
extend/os/linux/hardware/cpu: fix typo.
CPU was transformed into a class in 8d995e961f549e555f405d2567235dab53f6baad.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/os/linux/hardware/cpu.rb | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index ef25aabfc..48028da87 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -1,67 +1,68 @@ module Hardware class CPU - extend self + class << self - OPTIMIZATION_FLAGS = { - :penryn => "-march=core2 -msse4.1", - :core2 => "-march=core2", - :core => "-march=prescott" - }.freeze - def optimization_flags - OPTIMIZATION_FLAGS - end + OPTIMIZATION_FLAGS = { + :penryn => "-march=core2 -msse4.1", + :core2 => "-march=core2", + :core => "-march=prescott" + }.freeze + def optimization_flags + OPTIMIZATION_FLAGS + end - # Linux supports x86 only, and universal archs do not apply - def arch_32_bit - :i386 - end + # Linux supports x86 only, and universal archs do not apply + def arch_32_bit + :i386 + end - def arch_64_bit - :x86_64 - end + def arch_64_bit + :x86_64 + end - def universal_archs - [].extend ArchitectureListExtension - end + def universal_archs + [].extend ArchitectureListExtension + end - def cpuinfo - @cpuinfo ||= File.read("/proc/cpuinfo") - end + def cpuinfo + @cpuinfo ||= File.read("/proc/cpuinfo") + end - def type - @type ||= if cpuinfo =~ /Intel|AMD/ - :intel - else - :dunno + def type + @type ||= if cpuinfo =~ /Intel|AMD/ + :intel + else + :dunno + end end - end - def family - cpuinfo[/^cpu family\s*: ([0-9]+)/, 1].to_i - end - alias_method :intel_family, :family + def family + cpuinfo[/^cpu family\s*: ([0-9]+)/, 1].to_i + end + alias_method :intel_family, :family - def cores - cpuinfo.scan(/^processor/).size - end + def cores + cpuinfo.scan(/^processor/).size + end - def flags - @flags ||= cpuinfo[/^flags.*/, 0].split - end + def flags + @flags ||= cpuinfo[/^flags.*/, 0].split + end - # Compatibility with Mac method, which returns lowercase symbols - # instead of strings - def features - @features ||= flags[1..-1].map(&:intern) - end + # Compatibility with Mac method, which returns lowercase symbols + # instead of strings + def features + @features ||= flags[1..-1].map(&:intern) + end - %w[aes altivec avx avx2 lm sse3 ssse3 sse4 sse4_2].each do |flag| - define_method(flag + "?") { flags.include? flag } - end - alias_method :is_64_bit?, :lm? + %w[aes altivec avx avx2 lm sse3 ssse3 sse4 sse4_2].each do |flag| + define_method(flag + "?") { flags.include? flag } + end + alias_method :is_64_bit?, :lm? - def bits - is_64_bit? ? 64 : 32 + def bits + is_64_bit? ? 64 : 32 + end end end end |
