Sha256: f5cb667c9d4e0dce12cde9215fc05678b6b6db50442f4a945160cde561ab906f

Contents?: true

Size: 899 Bytes

Versions: 8

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

require 'toml'

module LicenseFinder
  class Dep < PackageManager
    def possible_package_paths
      [project_path.join('Gopkg.lock')]
    end

    def current_packages
      toml = TOML.load_file(detected_package_path)
      projects = toml['projects']

      return [] if projects.nil?

      projects.map do |project|
        GoPackage.from_dependency({
                                    'ImportPath' => project['name'],
                                    'InstallPath' => project_path.join('vendor', project['name']),
                                    'Rev' => project['revision']
                                  }, nil, true)
      end
    end

    def self.takes_priority_over
      Go15VendorExperiment
    end

    def self.prepare_command
      'dep ensure -vendor-only'
    end

    def self.package_management_command
      'dep'
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
license_finder-5.10.2 lib/license_finder/package_managers/dep.rb
license_finder-5.10.1 lib/license_finder/package_managers/dep.rb
license_finder-5.10.0 lib/license_finder/package_managers/dep.rb
license_finder-5.9.2 lib/license_finder/package_managers/dep.rb
license_finder-5.9.1 lib/license_finder/package_managers/dep.rb
license_finder-5.9.0 lib/license_finder/package_managers/dep.rb
license_finder-5.8.0 lib/license_finder/package_managers/dep.rb
license_finder-5.7.1 lib/license_finder/package_managers/dep.rb