Method: Pod::Podfile::TargetDefinition#store_podspec

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

#store_podspec(options = nil) ⇒ void

TODO:

This urgently needs a rename.

Note:

The storage of this information is optimized for YAML readability.

This method returns an undefined value.

Stores the podspec whose dependencies should be included by the target.

Parameters:

  • options (Hash) (defaults to: nil)

    The options used to find the podspec (either by name or by path). If nil the podspec is auto-detected (i.e. the first one in the folder of the Podfile)



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 741

def store_podspec(options = nil)
  options ||= {}
  unless options.keys.all? { |key| [:name, :path, :subspecs, :subspec].include?(key) }
    raise StandardError, 'Unrecognized options for the podspec ' \
      "method `#{options}`"
  end
  if subspec_name = options[:subspec]
    unless subspec_name.is_a?(String)
      raise StandardError, "Option `:subspec => #{subspec_name.inspect}` should be a String"
    end
  end
  if subspec_names = options[:subspecs]
    if !subspec_names.is_a?(Array) || !subspec_names.all? { |name| name.is_a? String }
      raise StandardError, "Option `:subspecs => #{subspec_names.inspect}` " \
      'should be an Array of Strings'
    end
  end
  options[:autodetect] = true if !options.include?(:name) && !options.include?(:path)
  get_hash_value('podspecs', []) << options
end