Top Level Namespace

Defined Under Namespace

Modules: CocoaPodsArt, Pod

Constant Summary collapse

UTIL =
Pod::RepoArt::RepoUtil

Instance Method Summary collapse

Instance Method Details

#create_source_from_name(source_name) ⇒ ArtSource

Returns source of the local spec repo which corresponds to to the given name

Parameters:

  • source_name

    > name of source incoming from the Podfile configuration

Returns:

  • (ArtSource)

    source of the local spec repo which corresponds to to the given name



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cocoapods_plugin.rb', line 21

def create_source_from_name(source_name)
    art_repo = "#{UTIL.get_repos_art_dir()}/#{source_name}"
    repos_dir = Pod::Config.instance.repos_dir
    repo = repos_dir + source_name

    Pod::UI.puts "#{art_repo}/.artpodrc\n"

    if File.exist?("#{art_repo}/.artpodrc")
        url = File.read("#{art_repo}/.artpodrc")
        Pod::ArtSource.new(art_repo, url)
    elsif Dir.exist?("#{repo}")
        Pod::ArtSource.new(repo, '');
    else
     raise Pod::Informative.exception "repo #{source_name} does not exist."
    end
end