Class: LicenseFinder::Pipenv
Instance Method Summary
collapse
#active?, #command_exists?, #current_packages_with_relations, #detected_package_path, #installed?, #package_management_command, #prepare, #prepare_command, #project_root?, takes_priority_over
Constructor Details
#initialize(options = {}) ⇒ Pipenv
8
9
10
11
|
# File 'lib/license_finder/package_managers/pipenv.rb', line 8
def initialize(options = {})
super
@lockfile = Pathname('Pipfile.lock')
end
|
Instance Method Details
#current_packages ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/license_finder/package_managers/pipenv.rb', line 13
def current_packages
@current_packages ||=
begin
packages = {}
each_dependency(groups: allowed_groups) do |name, data, group|
version = canonicalize(data['version'] || 'unknown')
package = packages.fetch(key_for(name, version)) do |key|
packages[key] = build_package_for(name, version)
end
package.groups << group
end
packages.values
end
end
|
#possible_package_paths ⇒ Object
28
29
30
|
# File 'lib/license_finder/package_managers/pipenv.rb', line 28
def possible_package_paths
project_path ? [project_path.join(@lockfile)] : [@lockfile]
end
|