class Pod::Downloader::Http

Constants

USER_AGENT_HEADER

Private Instance Methods

download_file(full_filename) click to toggle source
# File lib/cocoapods-downloader/http.rb, line 12
def download_file(full_filename)
  parameters = ['-f', '-L', '-o', full_filename, url, '--create-dirs', '--netrc-optional', '--retry', '2']
  parameters << user_agent_argument if headers.nil? ||
      headers.none? { |header| header.casecmp(USER_AGENT_HEADER).zero? }

  headers.each do |h|
    parameters << '-H'
    parameters << h
  end unless headers.nil?

  curl! parameters
end
user_agent_argument() click to toggle source

Returns a cURL command flag to add the CocoaPods User-Agent.

@return [String] cURL command -A flag and User-Agent.

# File lib/cocoapods-downloader/http.rb, line 29
def user_agent_argument
  "-A '#{Http.user_agent_string}'"
end