Class: LicenseFinder::Pip

Inherits:
PackageManager show all
Defined in:
lib/license_finder/package_managers/pip.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PackageManager

#active?, active_package_managers, active_packages, command_exists?, #current_packages_with_relations, #detected_package_path, installed?, package_managers, #prepare, prepare_command, takes_priority_over

Constructor Details

#initialize(options = {}) ⇒ Pip

Returns a new instance of Pip.



6
7
8
9
# File 'lib/license_finder/package_managers/pip.rb', line 6

def initialize(options = {})
  super
  @requirements_path = options[:pip_requirements_path] || Pathname('requirements.txt')
end

Class Method Details

.package_management_commandObject



24
25
26
# File 'lib/license_finder/package_managers/pip.rb', line 24

def self.package_management_command
  'pip'
end

Instance Method Details

#current_packagesObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/license_finder/package_managers/pip.rb', line 11

def current_packages
  pip_output.map do |name, version, children, location|
    PipPackage.new(
      name,
      version,
      pypi_def(name, version),
      logger: logger,
      children: children,
      install_path: Pathname(location).join(name)
    )
  end
end