Class: CurlGitHubPackagesDownloadStrategy
- Inherits:
-
CurlDownloadStrategy
- Object
- AbstractDownloadStrategy
- AbstractFileDownloadStrategy
- CurlDownloadStrategy
- CurlGitHubPackagesDownloadStrategy
- Defined in:
- download_strategy.rb
Overview
Strategy for downloading a file from an GitHub Packages URL.
Constant Summary
Constants inherited from CurlDownloadStrategy
CurlDownloadStrategy::URLMetadata
Instance Attribute Summary collapse
- #resolved_basename ⇒ String? writeonly private
Attributes inherited from CurlDownloadStrategy
Attributes inherited from AbstractDownloadStrategy
Instance Method Summary collapse
- #initialize(url, name, version, **meta) ⇒ void constructor private
Methods inherited from CurlDownloadStrategy
#clear_cache, #fetch, #resolved_time_file_size
Methods included from Utils::Curl
clear_path_cache, curl, curl_args, curl_check_http_content, curl_download, curl_executable, curl_headers, curl_http_content_headers_and_checksum, curl_output, curl_path, curl_response_follow_redirections, curl_response_last_location, curl_supports_fail_with_body?, curl_supports_tls13?, curl_version, curl_with_workarounds, http_status_ok?, parse_curl_output, url_protected_by_cloudflare?, url_protected_by_incapsula?
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods inherited from AbstractFileDownloadStrategy
#basename, #cached_location, #symlink_location, #temporary_path
Methods inherited from AbstractDownloadStrategy
#basename, #cached_location, #clear_cache, #fetch, #quiet!, #quiet?, #source_modified_time, #stage
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(url, name, version, **meta) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
702 703 704 705 706 707 708 709 710 711 712 713 |
# File 'download_strategy.rb', line 702 def initialize(url, name, version, **) [:headers] ||= [] # GitHub Packages authorization header. # HOMEBREW_GITHUB_PACKAGES_AUTH set in brew.sh # If using a private GHCR mirror with no Authentication set then do not add the header. In all other cases add it. if !Homebrew::EnvConfig.artifact_domain.presence || Homebrew::EnvConfig.docker_registry_basic_auth_token.presence || Homebrew::EnvConfig.docker_registry_token.presence [:headers] << "Authorization: #{HOMEBREW_GITHUB_PACKAGES_AUTH}" end super end |
Instance Attribute Details
#resolved_basename=(value) ⇒ String? (writeonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
699 700 701 |
# File 'download_strategy.rb', line 699 def resolved_basename=(value) @resolved_basename = value end |