aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/hardware.rb
diff options
context:
space:
mode:
authorJack Nagel2013-10-18 12:56:51 -0500
committerJack Nagel2013-10-18 12:56:51 -0500
commit1d0a7c66a5afd102a935d6dbafceb6b9768068ac (patch)
treebdb28e7d325c4d04a18c2dc59b568732749c9635 /Library/Homebrew/hardware.rb
parent81b0f33b7a7ecb96e9df2606dd5ac1fad21847cf (diff)
downloadhomebrew-1d0a7c66a5afd102a935d6dbafceb6b9768068ac.tar.bz2
Add OS.mac? and OS.linux?
Diffstat (limited to 'Library/Homebrew/hardware.rb')
-rw-r--r--Library/Homebrew/hardware.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb
index 44642d44f..0a52d10db 100644
--- a/Library/Homebrew/hardware.rb
+++ b/Library/Homebrew/hardware.rb
@@ -1,3 +1,5 @@
+require 'os'
+
class Hardware
module CPU extend self
INTEL_32BIT_ARCHS = [:i386].freeze
@@ -30,11 +32,10 @@ class Hardware
end
end
- case RUBY_PLATFORM.downcase
- when /darwin/
+ if OS.mac?
require 'os/mac/hardware'
CPU.extend MacCPUs
- when /linux/
+ elsif OS.linux?
require 'os/linux/hardware'
CPU.extend LinuxCPUs
else