Class: Procfs2::ProcVersion

Inherits:
ProcItem show all
Defined in:
lib/procfs2/proc_version.rb

Constant Summary collapse

LABEL =
:version
VERSION_RE =
/
(?<kernel>\w+)
\sversion\s
(?<version>[\w.-]+)
\s
\((?<user>\w+)@(?<host>[\w.-]+)\)
\s
\((?<gcc_version>[\w\s\(\).,-]+)\)
\s
(?<kernel_type>[\w#\s-]+)
\s
(?<timestamp>\w+\s+\w+\s+\d+\s+[\d:]+\s+\w+\s+\d+)
/x

Instance Attribute Summary

Attributes inherited from ProcItem

#_data, #_parent

Instance Method Summary collapse

Methods inherited from ProcItem

#_filename, #_path, #_raw_content, build, #initialize

Constructor Details

This class inherits a constructor from Procfs2::ProcItem

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Procfs2::ProcItem

Instance Method Details

#_parse_contentObject



23
24
25
26
27
28
# File 'lib/procfs2/proc_version.rb', line 23

def _parse_content
  return unless _raw_content
  return unless (match = _raw_content.match(VERSION_RE))

  @_data = match.names.zip(match.captures).to_h
end