Class: Hbc::CLI::Fetch

Inherits:
AbstractCommand show all
Defined in:
Library/Homebrew/cask/lib/hbc/cli/fetch.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractCommand

abstract?, command_name, run, visible

Methods included from Options

included, #process_arguments

Constructor Details

#initializeFetch

Returns a new instance of Fetch



6
7
8
9
# File 'Library/Homebrew/cask/lib/hbc/cli/fetch.rb', line 6

def initialize(*)
  super
  raise CaskUnspecifiedError if args.empty?
end

Class Method Details

.helpObject



24
25
26
# File 'Library/Homebrew/cask/lib/hbc/cli/fetch.rb', line 24

def self.help
  "downloads remote application files to local cache"
end

.needs_init?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'Library/Homebrew/cask/lib/hbc/cli/fetch.rb', line 20

def self.needs_init?
  true
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
# File 'Library/Homebrew/cask/lib/hbc/cli/fetch.rb', line 11

def run
  casks.each do |cask|
    ohai "Downloading external files for Cask #{cask}"
    downloaded_path = Download.new(cask, force: force?).perform
    Verify.all(cask, downloaded_path)
    ohai "Success! Downloaded to -> #{downloaded_path}"
  end
end