Class: Spandx::Dotnet::Parsers::Csproj

Inherits:
Core::Parser show all
Defined in:
lib/spandx/dotnet/parsers/csproj.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/csproj.rb', line 7

def match?(path)
  ['.csproj', '.props'].include?(path.extname)
end

#parse(path) ⇒ Object



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

def parse(path)
  ProjectFile
    .new(path)
    .package_references
    .map { |x| map_from(path, x) }
end