Class: Spandx::Dotnet::Parsers::PackagesConfig

Inherits:
Core::Parser
  • Object
show all
Defined in:
lib/spandx/dotnet/parsers/packages_config.rb

Constant Summary

Constants inherited from Core::Parser

Core::Parser::UNKNOWN

Instance Method Summary collapse

Methods inherited from Core::Parser

for, parse

Methods included from Core::Registerable

#all, #each, #inherited, #registry

Instance Method Details

#match?(path) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/spandx/dotnet/parsers/packages_config.rb', line 7

def match?(path)
  path.basename.fnmatch?('packages.config')
end

#parse(path) ⇒ Object



11
12
13
14
15
# File 'lib/spandx/dotnet/parsers/packages_config.rb', line 11

def parse(path)
  Nokogiri::XML(path.read)
    .search('//package')
    .map { |node| map_from(path, node) }
end