Class: Homebrew::API::JSONDownloadStrategy Private
- Inherits:
-
AbstractDownloadStrategy
- Object
- AbstractDownloadStrategy
- Homebrew::API::JSONDownloadStrategy
- Defined in:
- api/json_download.rb
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Constant Summary
Constants inherited from AbstractDownloadStrategy
AbstractDownloadStrategy::HOMEBREW_CONTROLLED_STRATEGIES
Instance Attribute Summary
Attributes inherited from AbstractDownloadStrategy
Instance Method Summary collapse
- #cached_location ⇒ Pathname private
- #fetch(timeout: nil) ⇒ Pathname private
- #fetched_size ⇒ Integer? private
Methods inherited from AbstractDownloadStrategy
#basename, #clear_cache, expand_deferred_environment_for?, #initialize, #ohai, #quiet!, #quiet?, #source_modified_time, #source_revision, #stage, #total_size
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods included from Context
current, current=, #debug?, #deferred_environment_expansion?, #quiet?, #verbose?, #with_context
Constructor Details
This class inherits a constructor from AbstractDownloadStrategy
Instance Method Details
#cached_location ⇒ Pathname
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.
23 24 25 |
# File 'api/json_download.rb', line 23 def cached_location .fetch(:target) end |
#fetch(timeout: nil) ⇒ Pathname
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.
10 11 12 13 14 15 |
# File 'api/json_download.rb', line 10 def fetch(timeout: nil) with_context quiet: quiet? do Homebrew::API.fetch_json_api_file(url, target: cached_location, stale_seconds: [:stale_seconds]) end cached_location end |
#fetched_size ⇒ Integer?
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.
18 19 20 |
# File 'api/json_download.rb', line 18 def fetched_size File.size?(cached_location) end |