2 # frozen_string_literal: true
6 source = Pod::Source.new('.')
8 shards = pods.each_with_object({}) do |pod, hash|
9 shard = source.metadata.path_fragment(pod)[0...-1].join('_')
10 versions = source.versions(pod).map(&:to_s).reverse
12 hash[shard][pod] = versions
15 # write all `all_pods_versions_2_2_2.txt` files that are structured like so:
16 # DfPodTest/0.0.1/0.0.2
17 shards.each do |shard, pods_versions|
18 File.open("#{ARGV[0]}/all_pods_versions_#{shard}.txt", 'w') do |file|
19 pods_versions.keys.sort.each do |pod|
20 row = [pod] + pods_versions[pod].sort
21 file.puts row.join('/')
25 STDERR.puts "Generated #{shards.count} shards"
27 # # write a list of all pods, separated by newline
28 File.open("#{ARGV[0]}/all_pods.txt", 'w') do |file|
33 STDERR.puts "Total pod count: #{pods.count}"
34 STDERR.puts "Total podspec count: #{shards.values.map(&:values).flatten.count}"
36 # get a list of all deprecated pods
37 deprecated_podspecs = Dir['Specs/**/*.podspec.json'].sort.select do |podspec_path|
38 podspec = Pod::Specification.from_file(podspec_path)
42 # write a list of all deprecated podspecs, separated by newline
43 File.open("#{ARGV[0]}/deprecated_podspecs.txt", 'w') do |file|
44 deprecated_podspecs.each do |podspec_path|
45 file.puts podspec_path
48 STDERR.puts "Deprecated podspec count: #{deprecated_podspecs.count}"