Sha256: 5c728130e25966a7f8b2cb0065d80fdb6b571edf927bbd8ece455790560a9d4f

Contents?: true

Size: 752 Bytes

Versions: 24

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

module LicenseFinder
  class GradlePackage < Package
    def initialize(spec, options = {})
      name = spec['name']
      if name.scan(':').size >= 1
        group, name, version = name.split(':')
      else
        version = 'unknown'
      end

      name = options[:include_groups] ? "#{group}:#{name}" : name

      licenses = Array(spec['license'])
                 .map { |l| l['name'] }
                 .reject { |reject_name| reject_name == 'No license found' }

      super(name, version, options.merge(spec_licenses: licenses))
    end

    def package_manager
      'Gradle'
    end

    def package_url
      "https://plugins.gradle.org/plugin/#{CGI.escape(name)}/#{CGI.escape(version)}"
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
license_finder-7.1.0 lib/license_finder/packages/gradle_package.rb
license_finder-7.0.1 lib/license_finder/packages/gradle_package.rb
license_finder-7.0.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.15.0 lib/license_finder/packages/gradle_package.rb
gitlab-license_finder-6.14.2.1 lib/license_finder/packages/gradle_package.rb
license_finder-6.14.2 lib/license_finder/packages/gradle_package.rb
license_finder-6.14.1 lib/license_finder/packages/gradle_package.rb
license_finder-6.13.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.12.2 lib/license_finder/packages/gradle_package.rb
license_finder-6.12.1 lib/license_finder/packages/gradle_package.rb
license_finder-6.12.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.11.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.10.1 lib/license_finder/packages/gradle_package.rb
license_finder-6.10.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.9.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.8.2 lib/license_finder/packages/gradle_package.rb
license_finder-6.8.1 lib/license_finder/packages/gradle_package.rb
license_finder-6.8.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.7.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.6.2 lib/license_finder/packages/gradle_package.rb