From 13d544e11e92ba8ea3788723432046f8dfe4adf9 Mon Sep 17 00:00:00 2001 From: BrewTestBot Date: Mon, 3 Aug 2015 13:09:07 +0100 Subject: Core files style updates. Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid --- Library/Homebrew/os/linux/hardware.rb | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'Library/Homebrew/os/linux') diff --git a/Library/Homebrew/os/linux/hardware.rb b/Library/Homebrew/os/linux/hardware.rb index 507639e3a..c8d7f4954 100644 --- a/Library/Homebrew/os/linux/hardware.rb +++ b/Library/Homebrew/os/linux/hardware.rb @@ -1,15 +1,25 @@ module LinuxCPUs OPTIMIZATION_FLAGS = { - :penryn => '-march=core2 -msse4.1', - :core2 => '-march=core2', - :core => '-march=prescott', + :penryn => "-march=core2 -msse4.1", + :core2 => "-march=core2", + :core => "-march=prescott" }.freeze - def optimization_flags; OPTIMIZATION_FLAGS; end + def optimization_flags + OPTIMIZATION_FLAGS + 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 universal_archs; [].extend ArchitectureListExtension; end + def arch_32_bit + :i386 + end + + def arch_64_bit + :x86_64 + end + + def universal_archs + [].extend ArchitectureListExtension + end def cpuinfo @cpuinfo ||= File.read("/proc/cpuinfo") @@ -42,9 +52,9 @@ module LinuxCPUs @features ||= flags[1..-1].map(&:intern) end - %w[aes altivec avx avx2 lm sse3 ssse3 sse4 sse4_2].each { |flag| + %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 -- cgit v1.2.3