Class: Cask::Cmd::Reinstall Private

Inherits:
Install show all
Defined in:
Library/Homebrew/cask/cmd/reinstall.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.

Implementation of the brew cask reinstall command.

Constant Summary

Constants inherited from Install

Install::OPTIONS

Constants inherited from AbstractCommand

AbstractCommand::OPTIONS

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Install

install_casks, min_named, parser

Methods inherited from AbstractCommand

abstract?, banner_args, banner_headline, command_name, help, #initialize, max_named, min_named, parser, run, short_description, visible?

Methods included from Homebrew::Search

#query_regexp, #search_casks, #search_descriptions, #search_formulae, #search_taps

Constructor Details

This class inherits a constructor from Cask::Cmd::AbstractCommand

Class Method Details

.descriptionObject

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.


10
11
12
# File 'Library/Homebrew/cask/cmd/reinstall.rb', line 10

def self.description
  "Reinstalls the given <cask>."
end

.reinstall_casks(*casks, verbose: nil, force: nil, skip_cask_deps: nil, binaries: nil, require_sha: nil, quarantine: nil) ⇒ Object

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.


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'Library/Homebrew/cask/cmd/reinstall.rb', line 26

def self.reinstall_casks(
  *casks,
  verbose: nil,
  force: nil,
  skip_cask_deps: nil,
  binaries: nil,
  require_sha: nil,
  quarantine: nil
)
  require "cask/installer"

  options = {
    binaries:       binaries,
    verbose:        verbose,
    force:          force,
    skip_cask_deps: skip_cask_deps,
    require_sha:    require_sha,
    quarantine:     quarantine,
  }.compact

  options[:quarantine] = true if options[:quarantine].nil?

  casks.each do |cask|
    Installer.new(cask, **options).reinstall
  end
end

Instance Method Details

#runObject

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
17
18
19
20
21
22
23
24
# File 'Library/Homebrew/cask/cmd/reinstall.rb', line 14

def run
  self.class.reinstall_casks(
    *casks,
    binaries:       args.binaries?,
    verbose:        args.verbose?,
    force:          args.force?,
    skip_cask_deps: args.skip_cask_deps?,
    require_sha:    args.require_sha?,
    quarantine:     args.quarantine?,
  )
end