aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/linux/hardware.rb
blob: 8fd4b09b964fa831e62ffbf8f6b3449d854730fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module LinuxHardware
  def cpu_type
    @@cpu_type ||= case `uname -m`
      when /x86_64/
        :intel
      when /i386/
        :intel
      else
        :dunno
      end
  end

  def intel_family
    :dunno
  end

  def processor_count
    `grep -c ^processor /proc/cpuinfo`.to_i
  end

  def is_64_bit?
    return @@is_64_bit if defined? @@is_64_bit
    @@is_64_bit = /64/ === `uname -m`
  end
end