Method: Pod::Source#specification_path

Defined in:
lib/cocoapods-core/source.rb

#specification_path(name, version) ⇒ Pathname

Returns the path of the specification with the given name and version.

Parameters:

  • name (String)

    the name of the Pod.

  • version (Version, String)

    the version for the specification.

Returns:

  • (Pathname)

    The path of the specification.

Raises:

  • (ArgumentError)


201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/cocoapods-core/source.rb', line 201

def specification_path(name, version)
  raise ArgumentError, 'No name' unless name
  raise ArgumentError, 'No version' unless version
  path = pod_path(name) + version.to_s
  specification_path = path + "#{name}.podspec.json"
  unless specification_path.exist?
    specification_path = path + "#{name}.podspec"
  end
  unless specification_path.exist?
    raise StandardError, "Unable to find the specification #{name} " \
      "(#{version}) in the #{self.name} source."
  end
  specification_path
end