Sha256: 760d35cd08c1fe73cbe5962c91cf4b4fd0d22b2546a84890dd0c23c1195c9160

Contents?: true

Size: 964 Bytes

Versions: 5

Compression:

Stored size: 964 Bytes

Contents

module LicenseFinder
  class PipPackage < Package
    def initialize(name, version, install_path, pypi_def)
      @name = name
      @version = version
      @install_path = install_path
      @pypi_def = pypi_def
    end

    attr_reader :name, :version

    def summary
      pypi_def.fetch("summary", "")
    end

    def description
      pypi_def.fetch("description", "")
    end

    def homepage
      pypi_def["home_page"]
    end

    def children
      [] # no way to determine child deps from pip (maybe?)
    end

    def groups
      [] # no concept of dev/test groups in pip (maybe?)
    end

    private

    attr_reader :install_path, :pypi_def

    def license_names_from_spec
      license = pypi_def["license"]

      return [license] if license && license != "UNKNOWN"

      pypi_def.
        fetch("classifiers", []).
        select { |c| c.start_with?("License") }.
        map { |c| c.gsub(/^License.*::\s*(.*)$/, '\1') }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
license_finder-1.1.1-java lib/license_finder/package_managers/pip_package.rb
license_finder-1.1.1 lib/license_finder/package_managers/pip_package.rb
license_finder-1.1.0 lib/license_finder/package_managers/pip_package.rb
license_finder-1.0.1 lib/license_finder/package_managers/pip_package.rb
license_finder-1.0.0.1 lib/license_finder/package_managers/pip_package.rb