Class: CurlApacheMirrorDownloadStrategy

Inherits:
CurlDownloadStrategy show all
Defined in:
Library/Homebrew/download_strategy.rb

Overview

Strategy for downloading a file from an Apache Mirror URL.

Instance Attribute Summary

Attributes inherited from AbstractDownloadStrategy

#cache, #cached_location, #source_modified_time, #url

Instance Method Summary collapse

Methods inherited from CurlDownloadStrategy

#clear_cache, #fetch, #initialize

Methods included from Utils::Curl

curl, curl_args, curl_check_http_content, curl_download, curl_executable, curl_http_content_headers_and_checksum, curl_output, curl_with_workarounds, http_status_ok?, url_protected_by_cloudflare?, url_protected_by_incapsula?

Methods inherited from AbstractFileDownloadStrategy

#basename, #cached_location, #symlink_location, #temporary_path

Methods inherited from AbstractDownloadStrategy

#basename, #clear_cache, #fetch, #initialize, #quiet?, #shutup!, #stage

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

This class inherits a constructor from CurlDownloadStrategy

Instance Method Details

#mirrorsObject


511
512
513
514
515
516
517
518
# File 'Library/Homebrew/download_strategy.rb', line 511

def mirrors
  return @combined_mirrors if defined?(@combined_mirrors)

  backup_mirrors = apache_mirrors.fetch("backup", [])
                                 .map { |mirror| "#{mirror}#{apache_mirrors["path_info"]}" }

  @combined_mirrors = [*@mirrors, *backup_mirrors]
end