Class: Pod::Source::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods_plugin.rb

Instance Method Summary collapse

Instance Method Details

#orig_source_from_pathObject



128
# File 'lib/cocoapods_plugin.rb', line 128

alias_method :orig_source_from_path, :source_from_path

#source_from_path(path) ⇒ Source

Returns The Source at a given path.

Parameters:

  • path (Pathname)

    The local file path to one podspec repo.

Returns:

  • (Source)

    The Source at a given path.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/cocoapods_plugin.rb', line 135

def source_from_path(path)
  @sources_by_path ||= Hash.new do |hash, key|
    art_repo = "#{UTIL.get_repos_art_dir()}/#{key.basename}"
    hash[key] = case
                when key.basename.to_s == Pod::TrunkSource::TRUNK_REPO_NAME
                  TrunkSource.new(key)
                when (key + '.url').exist?
                  CDNSource.new(key)
                when File.exist?("#{art_repo}/.artpodrc")
                  create_source_from_name(key.basename)
                else
                  Source.new(key)
                end
  end
  @sources_by_path[path]
end