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