Sha256: 81a2c7d5dbfb5b13391b151c1606c876a4af62e773305f3e1dd9bc9717a6e982

Contents?: true

Size: 619 Bytes

Versions: 14

Compression:

Stored size: 619 Bytes

Contents

module LicenseFinder
  class GoPackage < Package
    def package_manager
      'Go'
    end

    class << self
      def from_dependency(hash, prefix, full_version)
        name = hash['ImportPath']
        install_path = hash['InstallPath']
        install_path ||= install_path(prefix.join(name))
        version = full_version ? hash['Rev'] : hash['Rev'][0..6]
        homepage = hash['Homepage']
        new(name, version, install_path: install_path, package_manager: 'Go', homepage: homepage)
      end

      private

      def install_path(path)
        Pathname(path).cleanpath.to_s
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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