Class: Cask::Download Private

Inherits:
Object
  • Object
show all
Defined in:
Library/Homebrew/cask/download.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A download corresponding to a Cask.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cask, force: false, quarantine: nil) ⇒ Download

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Download.


16
17
18
19
20
# File 'Library/Homebrew/cask/download.rb', line 16

def initialize(cask, force: false, quarantine: nil)
  @cask = cask
  @force = force
  @quarantine = quarantine
end

Instance Attribute Details

#caskObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


14
15
16
# File 'Library/Homebrew/cask/download.rb', line 14

def cask
  @cask
end

Instance Method Details

#downloaderObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


29
30
31
32
33
34
# File 'Library/Homebrew/cask/download.rb', line 29

def downloader
  @downloader ||= begin
    strategy = DownloadStrategyDetector.detect(cask.url.to_s, cask.url.using)
    strategy.new(cask.url.to_s, cask.token, cask.version, cache: Cache.path, **cask.url.specs)
  end
end

#performObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


22
23
24
25
26
27
# File 'Library/Homebrew/cask/download.rb', line 22

def perform
  clear_cache
  fetch
  quarantine
  downloaded_path
end