Class: VpsbClient::Builders::IssueParser

Inherits:
SystemInfoParser show all
Defined in:
lib/vpsb_client/builders/system_info_parser.rb

Constant Summary collapse

REGEX =
'^(?<os>[^\\\\]+)(?: \\\\n \\\\l)?$'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SystemInfoParser

#find_matches, #find_matches!, #lines

Constructor Details

#initializeIssueParser

Returns a new instance of IssueParser.



117
118
119
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 117

def initialize
  super('cat /etc/issue')
end

Instance Attribute Details

#osObject (readonly)

Returns the value of attribute os.



113
114
115
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 113

def os
  @os
end

Instance Method Details

#parseObject



121
122
123
124
# File 'lib/vpsb_client/builders/system_info_parser.rb', line 121

def parse
  matches = find_matches!(REGEX)
  @os = matches[:os]
end