class Object

Public Instance Methods

create_source_with_url(url) click to toggle source
# File lib/cocoapods_plugin.rb, line 49
def create_source_with_url(url)
    name = name_for_url(url)
    repos_dir = Pod::Config.instance.repos_dir
    repo = repos_dir + name
    Pod::SvnSource.new(repo,url)
end
name_for_url(url) click to toggle source

@param [String] url The URL of the SVN repository

@return [String] a name for the repository

For now, this uses the last component of the URL as the name So my.server.com/somedir/Specs will return Specs

# File lib/cocoapods_plugin.rb, line 41
def name_for_url(url)
    return nil unless url
    delim = '/'
    components = url.split(delim)
    components.last
end
update_or_add_source(source) click to toggle source

@param [Source] source The source to add or update

@return [Void]

# File lib/cocoapods_plugin.rb, line 19
def update_or_add_source(source)
    name = source.name
    url = source.url
    dir = source.repo

    if dir.exist?
        argv = CLAide::ARGV.new([name])
        cmd = Pod::Command::RepoSvn::Update.new(argv)
    else
        argv = CLAide::ARGV.new([name, url])
        cmd = Pod::Command::RepoSvn::Add.new(argv)
    end

    cmd.run()
end