Class: CurlGitHubPackagesDownloadStrategy

Inherits:
CurlDownloadStrategy show all
Defined in:
download_strategy.rb

Overview

Strategy for downloading a file from an GitHub Packages URL.

Instance Attribute Summary collapse

Attributes inherited from CurlDownloadStrategy

#mirrors

Attributes inherited from AbstractDownloadStrategy

#cache, #cached_location, #source_modified_time, #url

Instance Method Summary collapse

Methods inherited from CurlDownloadStrategy

#clear_cache, #fetch, #resolved_time_file_size

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_path, curl_supports_tls13?, curl_with_workarounds, http_status_ok?, parse_headers, 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, #quiet?, #shutup!, #stage

Methods included from Context

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

Constructor Details

#initialize(url, name, version, **meta) ⇒ CurlGitHubPackagesDownloadStrategy

Returns a new instance of CurlGitHubPackagesDownloadStrategy.



595
596
597
598
599
600
601
# File 'download_strategy.rb', line 595

def initialize(url, name, version, **meta)
  meta ||= {}
  meta[:headers] ||= []
  token = Homebrew::EnvConfig.artifact_domain ? Homebrew::EnvConfig.docker_registry_token : "QQ=="
  meta[:headers] << "Authorization: Bearer #{token}" if token.present?
  super(url, name, version, meta)
end

Instance Attribute Details

#resolved_basename=(value) ⇒ Object



593
594
595
# File 'download_strategy.rb', line 593

def resolved_basename=(value)
  @resolved_basename = value
end