aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/hardware.rb
blob: 5c46a3d3c78f9076b7689f434fe73efa86b017d5 (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
26
27
28
29
30
31
32
33
module Hardware
  class << self
    # We won't change the name because of backward compatibility.
    # So disable rubocop here.
    def is_32_bit? # rubocop:disable Style/PredicateName
      !CPU.is_64_bit?
    end

    # We won't change the name because of backward compatibility.
    # So disable rubocop here.
    def is_64_bit? # rubocop:disable Style/PredicateName
      CPU.is_64_bit?
    end

    def bits
      Hardware::CPU.bits
    end

    def cpu_type
      Hardware::CPU.type
    end

    def cpu_family
      Hardware::CPU.family
    end
    alias_method :intel_family, :cpu_family
    alias_method :ppc_family, :cpu_family

    def processor_count
      Hardware::CPU.cores
    end
  end
end