2013-03-17 13:30:12 -05:00
|
|
|
class Hardware
|
|
|
|
class << self
|
2015-08-06 16:58:29 +08:00
|
|
|
# We won't change the name because of backward compatibility.
|
|
|
|
# So disable rubocop here.
|
|
|
|
def is_32_bit? # rubocop:disable Style/PredicateName
|
2015-08-03 13:09:07 +01:00
|
|
|
!CPU.is_64_bit?
|
2013-03-17 13:30:12 -05:00
|
|
|
end
|
|
|
|
|
2015-08-06 16:58:29 +08:00
|
|
|
# We won't change the name because of backward compatibility.
|
|
|
|
# So disable rubocop here.
|
|
|
|
def is_64_bit? # rubocop:disable Style/PredicateName
|
2013-03-17 13:30:12 -05:00
|
|
|
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
|