Class: LicenseScout::DependencyManager::Habitat
- Inherits:
-
Base
- Object
- Base
- LicenseScout::DependencyManager::Habitat
show all
- Defined in:
- lib/license_scout/dependency_manager/habitat.rb
Constant Summary
collapse
- DEFAULT_CHANNEL =
"stable".freeze
- FALLBACK_CHANNEL_FOR_FQ =
"unstable".freeze
Instance Attribute Summary
Attributes inherited from Base
#directory
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#dependencies ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 46
def dependencies
tdeps = Set.new(pkg_deps)
if pkg_deps.any?
pkg_deps.each do |pkg_dep|
unless pkg_info(pkg_dep).nil?
pkg_info(pkg_dep)["tdeps"].each { |dep| tdeps << to_ident(dep) }
end
end
tdeps.delete(nil)
tdeps.sort.map do |tdep|
o, n, v, r = tdep.split("/")
dep_name = "#{o}/#{n}"
dep_version = "#{v}-#{r}"
dependency = new_dependency(dep_name, dep_version, nil)
if pkg_info(tdep).nil?
LicenseScout::Log.warn("Could not find information for #{tdep} -- skipping")
else
license_from_manifest(pkg_info(tdep)["manifest"]).each do |spdx|
dependency.add_license(spdx, "https://bldr.habitat.sh/v1/depot/channels/#{o}/unstable/pkgs/#{n}/#{v}/#{r}")
end
end
dependency
end.compact
end
end
|
#detected? ⇒ Boolean
42
43
44
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 42
def detected?
File.exist?(plan_sh_path) || File.exist?(habitat_plan_sh_path)
end
|
#install_command ⇒ Object
38
39
40
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 38
def install_command
""
end
|
#name ⇒ Object
26
27
28
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 26
def name
"habitat"
end
|
#signature ⇒ Object
34
35
36
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 34
def signature
File.exist?(habitat_plan_sh_path) ? "habitat/plan.sh file" : "plan.sh file"
end
|
#type ⇒ Object
30
31
32
|
# File 'lib/license_scout/dependency_manager/habitat.rb', line 30
def type
"habitat"
end
|