Sha256: 1e762c984ade879f1f03aca21c6342340c80e155db2a4452412d2729f13f0411

Contents?: true

Size: 638 Bytes

Versions: 22

Compression:

Stored size: 638 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
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
license_finder-6.3.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.2.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.1.2 lib/license_finder/packages/gradle_package.rb
license_finder-6.1.0 lib/license_finder/packages/gradle_package.rb
license_finder-6.0.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.11.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.11.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.10.2 lib/license_finder/packages/gradle_package.rb
license_finder-5.10.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.10.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.9.2 lib/license_finder/packages/gradle_package.rb
license_finder-5.9.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.9.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.8.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.7.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.7.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.6.2 lib/license_finder/packages/gradle_package.rb
license_finder-5.6.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.6.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.5.2 lib/license_finder/packages/gradle_package.rb