Sha256: 9673ee6dce9d620941f239d79e943343bed213291d6787a391edc8d78c1c8eae

Contents?: true

Size: 573 Bytes

Versions: 12

Compression:

Stored size: 573 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 { |name| name == "No license found" }

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

    def package_manager
      'Gradle'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
license_finder-3.0.4 lib/license_finder/package_managers/gradle_package.rb
license_finder-3.0.2 lib/license_finder/package_managers/gradle_package.rb
license_finder-3.0.1 lib/license_finder/package_managers/gradle_package.rb
license_finder-3.0.0 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.2 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.1 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0.rc9 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0.rc8 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0.rc7 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0.rc6 lib/license_finder/package_managers/gradle_package.rb
license_finder-2.1.0.rc5 lib/license_finder/package_managers/gradle_package.rb