Class: Pod::Sandbox::PodspecFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-tj/native/podspec_finder.rb

Instance Method Summary collapse

Instance Method Details

#podspecsObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cocoapods-tj/native/podspec_finder.rb', line 8

def podspecs
  return @specs_by_name if @specs_by_name

  @specs_by_name = {}
  spec_files = Pathname.glob(root + '{,*}.podspec{,.json}')
  spec_files = spec_files.reject { |p| Specification::DEFAULT_TEMPLATE_EXTNAME.find { |e| p.to_s.end_with?(e) } }
  spec_files.sort_by { |p| -p.to_path.split(File::SEPARATOR).size }.each do |file|
    spec = Specification.from_file(file)
    spec.validate_cocoapods_version
    @specs_by_name[spec.name] = spec
  end
  @specs_by_name
end