Class: Spandx::Java::Gateway

Inherits:
Core::Gateway show all
Defined in:
lib/spandx/java/gateway.rb

Constant Summary collapse

DEFAULT_SOURCE =
'https://repo.maven.apache.org/maven2'

Instance Attribute Summary

Attributes inherited from Core::Gateway

#http

Instance Method Summary collapse

Methods inherited from Core::Gateway

#initialize

Methods included from Core::Registerable

#all, #each, #inherited, #registry

Constructor Details

This class inherits a constructor from Spandx::Core::Gateway

Instance Method Details

#licenses_for(dependency) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/spandx/java/gateway.rb', line 12

def licenses_for(dependency)
  group_id, artifact_id = dependency.name.split(':')
  (
    group_id: group_id,
    artifact_id: artifact_id,
    version: dependency.version
  ).licenses
end

#matches?(dependency) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/spandx/java/gateway.rb', line 8

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

#metadata_for(group_id:, artifact_id:, version:) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/spandx/java/gateway.rb', line 21

def (group_id:, artifact_id:, version:)
  ::Spandx::Java::Metadata.new(
    artifact_id: artifact_id,
    group_id: group_id,
    version: version,
    source: DEFAULT_SOURCE
  )
end