Class: LicenseFinder::GoDep
Class Method Summary
collapse
Instance Method Summary
collapse
#active?, #capture, command_exists?, current_packages, #current_packages_with_relations, installed?, package_managers
Constructor Details
#initialize(options = {}) ⇒ GoDep
Returns a new instance of GoDep.
6
7
8
9
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 6
def initialize(options={})
super
@full_version = options[:go_full_version]
end
|
Class Method Details
.package_management_command ⇒ Object
26
27
28
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 26
def self.package_management_command
"godep"
end
|
Instance Method Details
#current_packages ⇒ Object
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 11
def current_packages
json = JSON.parse(package_path.read)
deps = json['Deps'].each do |d|
next unless d['ImportPath'].include?('github.com')
d['ImportPath'] = d['ImportPath'].split('/')[0..2].join('/')
end
deps.uniq.map { |dep| GoPackage.from_dependency(dep, install_prefix, @full_version) }
end
|
#package_path ⇒ Object
22
23
24
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 22
def package_path
project_path.join('Godeps/Godeps.json')
end
|