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 inherited from AbstractFileDownloadStrategy

#basename, #cached_location, #symlink_location, #temporary_path

Methods inherited from AbstractDownloadStrategy

#basename, #clear_cache, #fetch, #initialize, #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


495
496
497
498
499
500
501
502
# File 'Library/Homebrew/download_strategy.rb', line 495

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