Sha256: 9482595f731a2e4429d647110e36d57eee02b8fd8c5539e6cf3dbd715f4bb1a8

Contents?: true

Size: 607 Bytes

Versions: 14

Compression:

Stored size: 607 Bytes

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
license_finder-5.4.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.4.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.3.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.2.3 lib/license_finder/packages/gradle_package.rb
license_finder-5.2.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.2.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.1.1 lib/license_finder/packages/gradle_package.rb
license_finder-5.1.0 lib/license_finder/packages/gradle_package.rb
license_finder-5.0.3 lib/license_finder/packages/gradle_package.rb
license_finder-5.0.2 lib/license_finder/packages/gradle_package.rb
license_finder-5.0.0 lib/license_finder/packages/gradle_package.rb
license_finder-4.0.2 lib/license_finder/package_managers/gradle_package.rb
license_finder-4.0.1 lib/license_finder/package_managers/gradle_package.rb
license_finder-3.1.1 lib/license_finder/package_managers/gradle_package.rb