Refactor and document Hardware.
This commit is contained in:
parent
8e78990176
commit
33c138751e
@ -11,10 +11,6 @@ module Hardware
|
||||
end
|
||||
end
|
||||
|
||||
def cpuinfo
|
||||
@cpuinfo ||= File.read("/proc/cpuinfo")
|
||||
end
|
||||
|
||||
def family
|
||||
return :arm if arm?
|
||||
return :ppc if ppc?
|
||||
@ -94,6 +90,12 @@ module Hardware
|
||||
def sse4?
|
||||
flags.include? "sse4_1"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def cpuinfo
|
||||
@cpuinfo ||= File.read("/proc/cpuinfo")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
|
||||
require "utils/popen"
|
||||
|
||||
# Helper module for querying hardware information.
|
||||
module Hardware
|
||||
# Helper module for querying CPU information.
|
||||
class CPU
|
||||
INTEL_32BIT_ARCHS = [:i386].freeze
|
||||
INTEL_64BIT_ARCHS = [:x86_64].freeze
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user