module Pod::ExternalSources

def self.from_dependency(dependency, podfile_path)

Returns:
  • (AbstractExternalSource) - an initialized instance of the concrete
def self.from_dependency(dependency, podfile_path)
  name   = dependency.root_name
  params = dependency.external_source
  klass  =  if params.key?(:git)          then GitSource
            elsif params.key?(:svn)       then SvnSource
            elsif params.key?(:hg)        then MercurialSource
            elsif params.key?(:podspec)   then PodspecSource
            elsif params.key?(:path)      then PathSource
            end
  if params.key?(:local)
    klass = PathSource
    UI.warn "The `:local` option of the Podfile has been renamed to `:path` and is deprecated." \
  end
  if klass
    klass.new(name, params, podfile_path)
  else
    msg = "Unknown external source parameters for `#{name}`: `#{params}`"
    raise Informative, msg
  end
end