Class: LicenseFinder::Cargo
Instance Method Summary
collapse
#active?, #command_exists?, #current_packages_with_relations, #detected_package_path, id, #initialize, #installed?, #prepare, #project_root?, takes_priority_over
Instance Method Details
#current_packages ⇒ Object
7
8
9
10
11
12
|
# File 'lib/license_finder/package_managers/cargo.rb', line 7
def current_packages
cargo_output.map do |package|
path = Dir.glob("#{Dir.home}/.cargo/registry/src/*/#{package['name']}-#{package['version']}").first
CargoPackage.new(package, logger: logger, install_path: path)
end
end
|
#package_management_command ⇒ Object
14
15
16
|
# File 'lib/license_finder/package_managers/cargo.rb', line 14
def package_management_command
'cargo'
end
|
#possible_package_paths ⇒ Object
22
23
24
|
# File 'lib/license_finder/package_managers/cargo.rb', line 22
def possible_package_paths
[project_path.join('Cargo.lock'), project_path.join('Cargo.toml')]
end
|
#prepare_command ⇒ Object
18
19
20
|
# File 'lib/license_finder/package_managers/cargo.rb', line 18
def prepare_command
'cargo fetch'
end
|