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?, active_package_managers, active_packages, command_exists?, #current_packages_with_relations, #detected_package_path, #initialize, installed?, package_managers, #prepare

Constructor Details

This class inherits a constructor from LicenseFinder::PackageManager

Class Method Details

.package_management_commandObject



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

def self.package_management_command
  'govendor'
end

.prepare_commandObject



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

def self.prepare_command
  'govendor sync'
end

.takes_priority_overObject



20
21
22
# File 'lib/license_finder/package_managers/govendor.rb', line 20

def self.takes_priority_over
  Go15VendorExperiment
end

Instance Method Details

#current_packagesObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/license_finder/package_managers/govendor.rb', line 7

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

#possible_package_pathsObject



3
4
5
# File 'lib/license_finder/package_managers/govendor.rb', line 3

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