Class: Kanrisuru::Core::Yum::Parser::Base
- Inherits:
-
Object
- Object
- Kanrisuru::Core::Yum::Parser::Base
show all
- Defined in:
- lib/kanrisuru/core/yum/parsers/base.rb
Class Method Summary
collapse
Class Method Details
9
10
11
12
|
# File 'lib/kanrisuru/core/yum/parsers/base.rb', line 9
def (line)
values = line.split(': ', 2)
values.length == 2 ? values[1] : ''
end
|
.parse_yum_line(line) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/kanrisuru/core/yum/parsers/base.rb', line 14
def parse_yum_line(line)
values = line.split
return if values.length != 3
return unless /^\w+\.\w+$/i.match(values[0])
full_name = values[0]
version = values[1]
name, architecture = full_name.split('.')
Kanrisuru::Core::Yum::PackageOverview.new(name, architecture, version)
end
|