Class: Cask::Cmd::Reinstall Private

Inherits:
Install show all
Extended by:
T::Sig
Defined in:
cask/cmd/reinstall.rb

Overview

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.

Cask implementation of the brew 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, parser

Methods inherited from AbstractCommand

abstract?, command_name, help, #initialize, parser, run, short_description, visible?

Methods included from Homebrew::Search

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

Methods included from Homebrew::Search::Extension

#search_casks, #search_descriptions

Constructor Details

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

Class Method Details

.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. 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.



25
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
# File 'cask/cmd/reinstall.rb', line 25

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

#runvoid

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.

This method returns an undefined value.



13
14
15
16
17
18
19
20
21
22
23
# File 'cask/cmd/reinstall.rb', line 13

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