6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/license_finder/package_managers/cocoa_pods.rb', line 6
def self.current_packages
podfile = YAML.load_file(lockfile_path)
acknowledgements = JSON.parse(`plutil -convert json -o - #{Pathname.new('Pods/Pods-acknowledgements.plist').expand_path}`)["PreferenceSpecifiers"]
podfile["PODS"].map do |pod|
pod = pod.keys.first if pod.is_a?(Hash)
pod_name, pod_version = pod.scan(/(.*)\s\((.*)\)/).flatten
pod_acknowledgment = acknowledgements.detect { |hash| hash["Title"] == pod_name } || {}
CocoaPodsPackage.new(pod_name, pod_version, pod_acknowledgment["FooterText"])
end
end
|