class CocoapodsRepoSq::Downloader
Implemenents a {github.com/CocoaPods/cocoapods-downloader downloader strategy} to support downloading files from a Square SDK repository server over the HTTPS protocol with {tools.ietf.org/html/rfc7617 Basic HTTP Authentication RFC7617}
Public Class Methods
Options accepted by this dowmloader strategy. The base class already supports `:flatten`, `:type`, `:sha256`, `:sha1`. {Downloader} supports passing a `:repository` option to indicate which Square SDK repository to download files from. If none is provided, it will try to use the current repository. See {Repository#current}
@return [Array<Symbol>]
a list of accepted options
# File lib/cocoapods_repo_sq/downloader.rb, line 57 def self.options super + [:repository] end
Public Instance Methods
Square SDK repository to be used by this downloader. It can be passed as an option when initializing this class or also taken from the current repository. See {Repository#current}
@return [CocoapodsRepoSq::Repository]
a Square SDK repository
# File lib/cocoapods_repo_sq/downloader.rb, line 67 def repository @repository ||= options.fetch(:repository) { Repository.current } end
Private Instance Methods
# File lib/cocoapods_repo_sq/downloader.rb, line 72 def download_file(full_filename) auth = "#{repository.username}:#{repository.password}" download_url = File.join(repository.url, url) curl! '-u', auth, '-f', '-L', '-o', full_filename, download_url, '--create-dirs', '--netrc-optional' end