Class: LicenseFinder::Govendor

Inherits:
PackageManager show all
Defined in:
lib/license_finder/package_managers/govendor.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/govendor.rb', line 24

def self.takes_priority_over
  Go15VendorExperiment
end

Instance Method Details

#current_packagesObject



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

def current_packages
  file = File.read(detected_package_path)
  packages = packages_from_json(file)
  packages.map do |package|
    GoPackage.from_dependency({
                                'ImportPath' => package[:path],
                                'InstallPath' => project_path.join('vendor', package[:path]),
                                'Rev' => package[:sha]
                              }, nil, true)
  end
end

#package_management_commandObject



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

def package_management_command
  'govendor'
end

#possible_package_pathsObject



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

def possible_package_paths
  [project_path.join('vendor', 'vendor.json')]
end

#prepare_commandObject



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

def prepare_command
  'govendor sync'
end