class Pod::Downloader::Subversion

Public Class Methods

options() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 4
def self.options
  [:revision, :tag, :folder, :externals, :checkout]
end

Public Instance Methods

checkout_options() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 12
def checkout_options
  Dir.chdir(target_path) do
    options = {}
    options[:svn] = url
    options[:revision] = @exported_revision
    options
  end
end
options_specific?() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 8
def options_specific?
  !(options[:revision] || options[:tag]).nil?
end

Private Instance Methods

download!() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 25
def download!
  output = svn!(*subcommand, *reference_url, @target_path)
  store_exported_revision(output)
end
download_head!() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 30
def download_head!
  output = svn!(*subcommand, *trunk_url, @target_path)
  store_exported_revision(output)
end
reference_url() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 52
def reference_url
  result = url.dup
  result << '/' << options[:folder] if options[:folder]
  result << '/tags/' << options[:tag] if options[:tag]
  result = [result]
  result << '-r' << options[:revision] if options[:revision]
  result
end
store_exported_revision(output) click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 35
def store_exported_revision(output)
  output =~ /Exported revision ([0-9]+)\./
  @exported_revision = Regexp.last_match[1] if Regexp.last_match
end
subcommand() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 40
def subcommand
  result = if options[:checkout]
             %w(checkout)
           else
             %w(export)
           end

  result += %w(--non-interactive --trust-server-cert --force)
  result << '--ignore-externals' if options[:externals] == false
  result
end
trunk_url() click to toggle source
# File lib/cocoapods-downloader/subversion.rb, line 61
def trunk_url
  result = url.dup
  result << '/' << options[:folder] if options[:folder]
  result << '/trunk'
  [result]
end