Class: Spandx::Java::Gateway
- Inherits:
-
Core::Gateway
- Object
- Core::Gateway
- Spandx::Java::Gateway
- Defined in:
- lib/spandx/java/gateway.rb
Constant Summary collapse
- DEFAULT_SOURCE =
'https://repo.maven.apache.org/maven2'
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
-
#initialize(http: Spandx.http) ⇒ Gateway
constructor
A new instance of Gateway.
- #licenses_for(dependency) ⇒ Object
- #matches?(dependency) ⇒ Boolean
- #metadata_for(group_id:, artifact_id:, version:) ⇒ Object
Methods included from Core::Registerable
#all, #each, #inherited, #registry
Constructor Details
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
8 9 10 |
# File 'lib/spandx/java/gateway.rb', line 8 def http @http end |
Instance Method Details
#licenses_for(dependency) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/spandx/java/gateway.rb', line 18 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
14 15 16 |
# File 'lib/spandx/java/gateway.rb', line 14 def matches?(dependency) dependency.package_manager == :maven end |
#metadata_for(group_id:, artifact_id:, version:) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/spandx/java/gateway.rb', line 27 def (group_id:, artifact_id:, version:) ::Spandx::Java::Metadata.new( artifact_id: artifact_id, group_id: group_id, version: version, source: DEFAULT_SOURCE ) end |