Sha256: bddc4f7611878d6776571b1a86c0e6261830ba6adb40f1cb01fb59e5f90e06cf

Contents?: true

Size: 602 Bytes

Versions: 22

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module LicenseFinder
  class CargoPackage < Package
    def initialize(crate, options = {})
      crate = crate.reject { |_, v| v.nil? || v == '' }
      children = crate.fetch('dependencies', []).map { |p| p['name'] }
      licenses = crate.fetch('license', '').split('/')
      super(
        crate['name'],
        crate['version'],
        options.merge(
          summary: crate.fetch('description', '').strip,
          spec_licenses: licenses.compact,
          children: children
        )
      )
    end

    def package_manager
      'Cargo'
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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