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
32
33
34
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 32
def self.package_management_command
"godep"
end
|
Instance Method Details
#current_packages ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 11
def current_packages
json = JSON.parse(package_path.read)
dependencies_info = json['Deps'].map do |json|
{
'Homepage' => homepage(json),
'ImportPath' => import_path(json),
'InstallPath' => json['InstallPath'],
'Rev' => json['Rev']
}
end
dependencies_info.uniq.map do |info|
GoPackage.from_dependency(info, install_prefix, @full_version)
end
end
|
#package_path ⇒ Object
28
29
30
|
# File 'lib/license_finder/package_managers/go_dep.rb', line 28
def package_path
project_path.join('Godeps/Godeps.json')
end
|