Class: LicenseFinder::Glide

Inherits:
PackageManager show all
Defined in:
lib/license_finder/package_managers/glide.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PackageManager

#active?, #command_exists?, #current_packages_with_relations, #detected_package_path, id, #initialize, #installed?, #prepare, #project_root?

Constructor Details

This class inherits a constructor from LicenseFinder::PackageManager

Class Method Details

.takes_priority_overObject



24
25
26
# File 'lib/license_finder/package_managers/glide.rb', line 24

def self.takes_priority_over
  Go15VendorExperiment
end

Instance Method Details

#current_packagesObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/license_finder/package_managers/glide.rb', line 9

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 = project_path.join('vendor', import_path)

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

#package_management_commandObject



28
29
30
# File 'lib/license_finder/package_managers/glide.rb', line 28

def package_management_command
  'glide'
end

#possible_package_pathsObject



5
6
7
# File 'lib/license_finder/package_managers/glide.rb', line 5

def possible_package_paths
  [project_path.join('glide.lock')]
end

#prepare_commandObject



32
33
34
# File 'lib/license_finder/package_managers/glide.rb', line 32

def prepare_command
  'glide install'
end