Spec-Zone.ru › Homebrew

Module: Homebrew::API::CaskDownload Private

Defined in:
api/cask_download.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Class Method Summary collapse

  • .download(token:, cask_struct:, quarantine: nil, require_sha: false) ⇒ ::Cask::Download? private

Class Method Details

.download(token:, cask_struct:, quarantine: nil, require_sha: false) ⇒ ::Cask::Download?

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.

Parameters:

  • token (String)
  • cask_struct (Homebrew::API::CaskStruct)
  • quarantine (Boolean, nil) (defaults to: nil)
  • require_sha (Boolean) (defaults to: false)

Returns:

  • (::Cask::Download, nil)


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'api/cask_download.rb', line 19

def self.download(token:, cask_struct:, quarantine: nil, require_sha: false)
  return if cask_struct.languages.any?
  return if cask_struct.url_args.empty?

  cask = ::Cask::Cask.new(
    token,
    tap:                      CoreCaskTap.instance,
    loaded_from_api:          true,
    loaded_from_internal_api: true,
  ) do
    version cask_struct.version
    sha256 cask_struct.sha256
    url(*cask_struct.url_args, **cask_struct.url_kwargs)
    homepage cask_struct.homepage if cask_struct.homepage?
  end

  ::Cask::Download.new(cask, quarantine:, require_sha:)
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Homebrew/API/CaskDownload.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API