Class: Spandx::Os::Parsers::Dpkg
- Inherits:
-
Core::Parser
- Object
- Core::Parser
- Spandx::Os::Parsers::Dpkg
- Defined in:
- lib/spandx/os/parsers/dpkg.rb
Defined Under Namespace
Classes: LineReader
Constant Summary
Constants inherited from Core::Parser
Instance Method Summary collapse
Methods inherited from Core::Parser
Methods included from Core::Registerable
#all, #each, #inherited, #registry
Instance Method Details
#match?(path) ⇒ Boolean
42 43 44 |
# File 'lib/spandx/os/parsers/dpkg.rb', line 42 def match?(path) path.basename.fnmatch?('status') end |
#parse(lockfile) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/spandx/os/parsers/dpkg.rb', line 46 def parse(lockfile) [].tap do |items| lockfile.open(mode: 'r') do |io| LineReader.new(io).each do |data| items.push(map_from(data, lockfile.to_s)) end end end end |