Class: Spandx::Dotnet::NugetGateway

Inherits:
Core::Gateway show all
Defined in:
lib/spandx/dotnet/nuget_gateway.rb

Overview

Instance Method Summary collapse

Methods included from Core::Registerable

#all, #inherited, #registry

Constructor Details

#initialize(http: Spandx.http) ⇒ NugetGateway

Returns a new instance of NugetGateway.



9
10
11
# File 'lib/spandx/dotnet/nuget_gateway.rb', line 9

def initialize(http: Spandx.http)
  @http = http
end

Instance Method Details

#each(start_page: 0) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/spandx/dotnet/nuget_gateway.rb', line 21

def each(start_page: 0)
  each_page(start_page: start_page) do |page_json|
    items_from(page_json).each do |item|
      yield(fetch_json(item['@id']), page_number_from(page_json['@id']))
    end
  end
end

#licenses_for(dependency) ⇒ Object



13
14
15
# File 'lib/spandx/dotnet/nuget_gateway.rb', line 13

def licenses_for(dependency)
  extract_licenses_from(nuspec_for(dependency.name, dependency.version))
end

#matches?(dependency) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/spandx/dotnet/nuget_gateway.rb', line 17

def matches?(dependency)
  dependency.package_manager == :nuget
end