Class: LicenseFinder::CocoaPods

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

Instance Method Summary collapse

Methods inherited from PackageManager

#active?, #command_exists?, #current_packages_with_relations, #detected_package_path, id, #initialize, #installed?, #prepare, #prepare_command, #project_root?, takes_priority_over

Constructor Details

This class inherits a constructor from LicenseFinder::PackageManager

Instance Method Details

#current_packagesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/license_finder/package_managers/cocoa_pods.rb', line 8

def current_packages
  podfile = YAML.load_file(lockfile_path)

  podfile['PODS'].map do |pod|
    pod = pod.keys.first if pod.is_a?(Hash)

    name, version = pod.scan(/(.*)\s\((.*)\)/).flatten

    CocoaPodsPackage.new(
      name,
      version,
      license_texts[name],
      logger: logger
    )
  end
end

#package_management_commandObject



25
26
27
# File 'lib/license_finder/package_managers/cocoa_pods.rb', line 25

def package_management_command
  LicenseFinder::Platform.darwin? ? 'pod' : nil
end

#possible_package_pathsObject



29
30
31
# File 'lib/license_finder/package_managers/cocoa_pods.rb', line 29

def possible_package_paths
  [project_path.join('Podfile')]
end