lib/spandx/dotnet/parsers/packages_config.rb in spandx-0.11.0 vs lib/spandx/dotnet/parsers/packages_config.rb in spandx-0.12.0

- old
+ new

@@ -2,11 +2,11 @@ module Spandx module Dotnet module Parsers class PackagesConfig < ::Spandx::Core::Parser - def self.matches?(filename) + def matches?(filename) filename.match?(/packages\.config/) end def parse(lockfile) Nokogiri::XML(IO.read(lockfile)) @@ -17,22 +17,14 @@ private def map_from(node) name = attribute_for('id', node) version = attribute_for('version', node) - ::Spandx::Core::Dependency.new( - name: name, - version: version, - licenses: nuget.licenses_for(name, version).map { |x| catalogue[x] } - ) + ::Spandx::Core::Dependency.new(package_manager: :nuget, name: name, version: version) end def attribute_for(key, node) node.attribute(key)&.value&.strip || node.at_xpath("./#{key}")&.content&.strip - end - - def nuget - @nuget ||= NugetGateway.new(catalogue: catalogue) end end end end end