aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os
diff options
context:
space:
mode:
authorJack Nagel2013-11-26 20:23:19 -0600
committerJack Nagel2013-11-26 20:23:19 -0600
commit91a69c6e2c20fe5e170a06171dd08bf986235f71 (patch)
treece2fa3460d62e26e4d61df3402982a8c5bb14d0c /Library/Homebrew/os
parentf26bea19ab4ce843849fbcd67f4f6f0428257690 (diff)
downloadhomebrew-91a69c6e2c20fe5e170a06171dd08bf986235f71.tar.bz2
Add Hardware::CPU.intel? and Hardware::CPU.ppc?
Diffstat (limited to 'Library/Homebrew/os')
-rw-r--r--Library/Homebrew/os/mac/hardware.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb
index 53a9a6463..888a99b1b 100644
--- a/Library/Homebrew/os/mac/hardware.rb
+++ b/Library/Homebrew/os/mac/hardware.rb
@@ -27,9 +27,8 @@ module MacCPUs
end
def family
- if type == :intel
- @intel_family ||= `/usr/sbin/sysctl -n hw.cpufamily`.to_i
- case @intel_family
+ if intel?
+ case @intel_family ||= `/usr/sbin/sysctl -n hw.cpufamily`.to_i
when 0x73d67300 # Yonah: Core Solo/Duo
:core
when 0x426f69ef # Merom: Core 2 Duo
@@ -49,9 +48,8 @@ module MacCPUs
else
:dunno
end
- elsif type == :ppc
- @ppc_family ||= `/usr/sbin/sysctl -n hw.cpusubtype`.to_i
- case @ppc_family
+ elsif ppc?
+ case @ppc_family ||= `/usr/sbin/sysctl -n hw.cpusubtype`.to_i
when 9
:g3 # PowerPC 750
when 10
@@ -81,11 +79,11 @@ module MacCPUs
end
def arch_32_bit
- type == :intel ? :i386 : :ppc
+ intel? ? :i386 : :ppc
end
def arch_64_bit
- type == :intel ? :x86_64 : :ppc64
+ intel? ? :x86_64 : :ppc64
end
# Returns an array that's been extended with ArchitectureListExtension,