Class: Spandx::Php::PackagistGateway
- Inherits:
-
Core::Gateway
- Object
- Core::Gateway
- Spandx::Php::PackagistGateway
- Defined in:
- lib/spandx/php/packagist_gateway.rb
Instance Attribute Summary
Attributes inherited from Core::Gateway
Instance Method Summary collapse
Methods inherited from Core::Gateway
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
10 11 12 13 14 15 16 |
# File 'lib/spandx/php/packagist_gateway.rb', line 10 def licenses_for(dependency) response = http.get("https://repo.packagist.org/p/#{dependency.name}.json") return [] unless http.ok?(response) json = Oj.load(response.body) json['packages'][dependency.name][dependency.version]['license'] end |
#matches?(dependency) ⇒ Boolean
6 7 8 |
# File 'lib/spandx/php/packagist_gateway.rb', line 6 def matches?(dependency) dependency.package_manager == :composer end |