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, #url

Instance Method Summary collapse

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_tls13?, 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 included from Kernel

#disk_usage_readable, #ensure_executable!, #ensure_formula_installed!, #exec_browser, #exec_editor, #ignore_interrupts, #interactive_shell, #number_readable, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #paths, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #quiet_system, #redact_secrets, #redirect_stdout, #require?, #safe_system, #tap_and_name_comparison, #truncate_text_to_approximate_size, #which, #which_all, #which_editor, #with_custom_locale, #with_env, #with_homebrew_path

Methods inherited from AbstractFileDownloadStrategy

#basename, #cached_location, #symlink_location, #temporary_path

Methods inherited from AbstractDownloadStrategy

#basename, #clear_cache, #fetch, #quiet!, #quiet?, #shutup!, #source_modified_time, #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.



617
618
619
620
621
622
623
# File 'download_strategy.rb', line 617

def initialize(url, name, version, **meta)
  meta[:headers] ||= []
  # GitHub Packages authorization header.
  # HOMEBREW_GITHUB_PACKAGES_AUTH set in brew.sh
  meta[:headers] << "Authorization: #{HOMEBREW_GITHUB_PACKAGES_AUTH}"
  super(url, name, version, **meta)
end

Instance Attribute Details

#resolved_basename=(value) ⇒ Object (writeonly)



615
616
617
# File 'download_strategy.rb', line 615

def resolved_basename=(value)
  @resolved_basename = value
end