Class: LicenseFinder::Gvt

Inherits:
PackageManager show all
Defined in:
lib/license_finder/package_managers/gvt.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



30
31
32
# File 'lib/license_finder/package_managers/gvt.rb', line 30

def self.takes_priority_over
  Go15VendorExperiment
end

Instance Method Details

#current_packagesObject



20
21
22
23
24
25
26
27
28
# File 'lib/license_finder/package_managers/gvt.rb', line 20

def current_packages
  shell_command = "cd #{project_path} && gvt list -f \"{{.Importpath}} {{.Revision}} {{.Repository}}\""
  path = project_path.join(project_path, 'vendor')

  stdout, _stderr, status = Cmd.run(shell_command)
  return [] unless status.success?

  packages_from_output(stdout, path)
end

#package_management_commandObject



12
13
14
# File 'lib/license_finder/package_managers/gvt.rb', line 12

def package_management_command
  'gvt'
end

#possible_package_pathsObject



7
8
9
10
# File 'lib/license_finder/package_managers/gvt.rb', line 7

def possible_package_paths
  potential_path = project_path.join('vendor', 'manifest')
  [Pathname(potential_path)]
end

#prepare_commandObject



16
17
18
# File 'lib/license_finder/package_managers/gvt.rb', line 16

def prepare_command
  'gvt restore'
end