Sha256: 62fdc6636bb5afb29c9990b4e8797254662e0d45ee24c486d14690730c7988c0

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module LicenseFinder
  class Glide < PackageManager
    def possible_package_paths
      [project_path.join('src', 'glide.lock'), project_path.join('glide.lock')]
    end

    def current_packages
      detected_path = detected_package_path

      YAML.load_file(detected_path).fetch('imports').map do |package_hash|
        import_path = package_hash.fetch('name')
        license_path =
          if detected_path == possible_package_paths.first
            project_path.join('src', 'vendor', import_path)
          else
            project_path.join('vendor', import_path)
          end

        GoPackage.from_dependency({
                                    'ImportPath' => import_path,
                                    'InstallPath' => license_path,
                                    'Rev' => package_hash.fetch('version')
                                  }, nil, true)
      end
    end

    def self.takes_priority_over
      Go15VendorExperiment
    end

    def self.package_management_command
      'glide'
    end

    def self.prepare_command
      'glide install'
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
license_finder-5.10.2 lib/license_finder/package_managers/glide.rb
license_finder-5.10.1 lib/license_finder/package_managers/glide.rb
license_finder-5.10.0 lib/license_finder/package_managers/glide.rb
license_finder-5.9.2 lib/license_finder/package_managers/glide.rb
license_finder-5.9.1 lib/license_finder/package_managers/glide.rb
license_finder-5.9.0 lib/license_finder/package_managers/glide.rb
license_finder-5.8.0 lib/license_finder/package_managers/glide.rb
license_finder-5.7.1 lib/license_finder/package_managers/glide.rb
license_finder-5.7.0 lib/license_finder/package_managers/glide.rb
license_finder-5.6.2 lib/license_finder/package_managers/glide.rb
license_finder-5.6.1 lib/license_finder/package_managers/glide.rb
license_finder-5.6.0 lib/license_finder/package_managers/glide.rb
license_finder-5.5.2 lib/license_finder/package_managers/glide.rb
license_finder-5.5.1 lib/license_finder/package_managers/glide.rb
license_finder-5.5.0 lib/license_finder/package_managers/glide.rb