Class: Homebrew::API::Download Private

Inherits:
Object
  • Object
show all
Includes:
Downloadable
Defined in:
api/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.

Instance Attribute Summary

Attributes included from Downloadable

#checksum, #mirrors, #url

Instance Method Summary collapse

Methods included from Downloadable

#cached_download, #clear_cache, #download_name, #download_strategy, #downloaded?, #fetch, #freeze, #initialize_dup, #verify_download_integrity, #version

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

#initialize(url, checksum, mirrors: [], cache: nil) ⇒ 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.

Parameters:



26
27
28
29
30
31
32
# File 'api/download.rb', line 26

def initialize(url, checksum, mirrors: [], cache: nil)
  super()
  @url = T.let(URL.new(url, using: API::DownloadStrategy), URL)
  @checksum = checksum
  @mirrors = mirrors
  @cache = cache
end

Instance Method Details

#cachePathname

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.

Returns:



50
51
52
# File 'api/download.rb', line 50

def cache
  @cache || super
end

#download_typeString

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.

Returns:



45
46
47
# File 'api/download.rb', line 45

def download_type
  "API source"
end

#downloaderAPI::DownloadStrategy

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.



35
36
37
# File 'api/download.rb', line 35

def downloader
  T.cast(super, API::DownloadStrategy)
end

#nameString

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.

Returns:



40
41
42
# File 'api/download.rb', line 40

def name
  download_name
end

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.

Returns:



55
56
57
# File 'api/download.rb', line 55

def symlink_location
  downloader.symlink_location
end