class Pod::Downloader::Http
Public Class Methods
options()
click to toggle source
Force flattening of index downloads with :indexDownload => true
# File lib/cocoapods_plugin.rb, line 46 def self.options [:type, :flatten, :sha1, :sha256, :indexDownload, :headers] end
Public Instance Methods
download_file(full_filename)
click to toggle source
# File lib/cocoapods_plugin.rb, line 53 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? } ssl_conf = ["--cert", `git config --global http.sslcert`.gsub("\n", ""), "--key", `git config --global http.sslkey`.gsub("\n", "")] parameters.concat(ssl_conf) if !ssl_conf.any?(&:blank?) netrc_path = ENV["COCOAPODS_ART_NETRC_PATH"] parameters.concat(["--netrc-file", Pathname.new(netrc_path).expand_path]) if netrc_path art_credentials = ENV["COCOAPODS_ART_CREDENTIALS"] parameters.concat(["--user", art_credentials]) if art_credentials winssl_no_revoke = ENV["COCOAPODS_ART_SSL_NO_REVOKE"] parameters.concat(["--ssl-no-revoke"]) if defined? winssl_no_revoke && "true".casecmp(winssl_no_revoke) headers.each do |h| parameters << '-H' parameters << h end unless headers.nil? curl! parameters end
Also aliased as: orig_download_file
should_flatten?()
click to toggle source
Note that we disabled flattening here for the ENTIRE client to deal with default flattening for non zip archives messing up tarballs incoming
# File lib/cocoapods_plugin.rb, line 80 def should_flatten? # TODO uncomment when Artifactory stops sending the :flatten flag # if options.key?(:flatten) # true # else # false # end if options.key?(:indexDownload) true else orig_should_flatten? end end
Also aliased as: orig_should_flatten?