Method: Pod::Podfile::TargetDefinition#parse_subspecs

Defined in:
lib/cocoapods-core/podfile/target_definition.rb

#parse_subspecs(name, requirements) ⇒ Boolean (private)

Removes :subspecs and :testspecs from the requirements list, and stores the pods with the given subspecs or test specs as dependencies.

Parameters:

  • name (String)
  • requirements (Array)

    If :subspecs is the only key in the hash, the hash should be destroyed because it confuses Gem::Dependency.

Returns:

  • (Boolean)

    Whether new subspecs were added



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 1152

def parse_subspecs(name, requirements)
  options = requirements.last
  return false unless options.is_a?(Hash)

  subspecs = options.delete(:subspecs)
  test_specs = options.delete(:testspecs)
  app_specs = options.delete(:appspecs)

  subspecs.each do |ss|
    store_pod("#{name}/#{ss}", *requirements.dup)
  end if subspecs

  test_specs.each do |ss|
    requirements_copy = requirements.map(&:dup)
    store_pod("#{name}/#{ss}", *requirements_copy)
  end if test_specs

  app_specs.each do |as|
    requirements_copy = requirements.map(&:dup)
    store_pod("#{name}/#{as}", *requirements_copy)
  end if app_specs

  requirements.pop if options.empty?
  !subspecs.nil?
end