Class: LicenseFinder::GradlePackage
- Defined in:
- lib/license_finder/packages/gradle_package.rb
Instance Attribute Summary
Attributes inherited from Package
#authors, #children, #description, #groups, #homepage, #install_path, #license_names_from_spec, #logger, #manual_approval, #name, #parents, #summary, #version
Instance Method Summary collapse
-
#initialize(spec, options = {}) ⇒ GradlePackage
constructor
A new instance of GradlePackage.
- #package_manager ⇒ Object
- #package_url ⇒ Object
Methods inherited from Package
#<=>, #activations, #approved?, #approved_manually!, #approved_manually?, #decide_on_license, #eql?, #hash, #license_files, license_names_from_standard_spec, #licenses, #licenses_from_spec, #licensing, #log_activation, #missing?, #notice_files, #permitted!, #permitted?, #restricted!, #restricted?
Constructor Details
#initialize(spec, options = {}) ⇒ GradlePackage
Returns a new instance of GradlePackage.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/license_finder/packages/gradle_package.rb', line 5 def initialize(spec, = {}) name = spec['name'] if name.scan(':').size >= 1 group, name, version = name.split(':') else version = 'unknown' end name = [:include_groups] ? "#{group}:#{name}" : name licenses = Array(spec['license']) .map { |l| l['name'] } .reject { |reject_name| reject_name == 'No license found' } super(name, version, .merge(spec_licenses: licenses)) end |
Instance Method Details
#package_manager ⇒ Object
22 23 24 |
# File 'lib/license_finder/packages/gradle_package.rb', line 22 def package_manager 'Gradle' end |
#package_url ⇒ Object
26 27 28 |
# File 'lib/license_finder/packages/gradle_package.rb', line 26 def package_url "https://plugins.gradle.org/plugin/#{CGI.escape(name)}/#{CGI.escape(version)}" end |