aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/hardware.rb
diff options
context:
space:
mode:
authorBen Alpert2009-09-18 12:50:01 -0600
committerBen Alpert2009-09-24 16:30:26 -0600
commit5d7cab9703339c634228aacd7937a95e3bebd3a4 (patch)
treecd488698f24dab7807fc464b944e7bc4ad164a95 /Library/Homebrew/hardware.rb
parente698609ada49a1700507f54cc5cc450566552262 (diff)
downloadhomebrew-5d7cab9703339c634228aacd7937a95e3bebd3a4.tar.bz2
Add Hardware.is_64_bit? method
Closes #53
Diffstat (limited to 'Library/Homebrew/hardware.rb')
-rw-r--r--Library/Homebrew/hardware.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb
index 3059f0875..18d4e6665 100644
--- a/Library/Homebrew/hardware.rb
+++ b/Library/Homebrew/hardware.rb
@@ -60,6 +60,10 @@ class Hardware
@@processor_count ||= `/usr/sbin/sysctl -n hw.ncpu`.to_i
end
+ def self.is_64_bit?
+ self.sysctl_bool("hw.cpu64bit_capable")
+ end
+
protected
def self.sysctl_bool(property)
result = nil