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, #total_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, parse_curl_response, url_protected_by_cloudflare?, url_protected_by_incapsula?
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods inherited from AbstractFileDownloadStrategy
#basename, #cached_location, #create_symlink_to_cached_download, #fetched_size, #symlink_location, #temporary_path
Methods inherited from AbstractDownloadStrategy
#basename, #cached_location, #clear_cache, #fetch, #fetched_size, #ohai, #quiet!, #quiet?, #source_modified_time, #stage, #total_size
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
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.
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 |
# File 'download_strategy.rb', line 723 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 or HOMEBREW_GITHUB_PACKAGES_AUTH is empty # then do not add the header. In all other cases add it. if HOMEBREW_GITHUB_PACKAGES_AUTH.presence && ( !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.
720 721 722 |
# File 'download_strategy.rb', line 720 def resolved_basename=(value) @resolved_basename = value end |