Class: Cask::Cmd::Install Private
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- Cask::Cmd::Install
- Defined in:
- Library/Homebrew/cask/cmd/install.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 install
command.
Direct Known Subclasses
Constant Summary collapse
- OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[ [:switch, "--skip-cask-deps", { description: "Skip installing cask dependencies.", }], ].freeze
Instance Attribute Summary
Attributes inherited from AbstractCommand
Class Method Summary collapse
- .description ⇒ Object private
- .install_casks(*casks, verbose: nil, force: nil, binaries: nil, skip_cask_deps: nil, require_sha: nil, quarantine: nil) ⇒ Object private
- .min_named ⇒ Object private
- .parser(&block) ⇒ Object private
Instance Method Summary collapse
- #run ⇒ Object private
Methods inherited from AbstractCommand
abstract?, banner_args, banner_headline, command_name, help, #initialize, max_named, 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
.description ⇒ 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.
14 15 16 |
# File 'Library/Homebrew/cask/cmd/install.rb', line 14 def self.description "Installs the given <cask>." end |
.install_casks(*casks, verbose: nil, force: nil, binaries: nil, skip_cask_deps: 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.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'Library/Homebrew/cask/cmd/install.rb', line 49 def self.install_casks( *casks, verbose: nil, force: nil, binaries: nil, skip_cask_deps: nil, require_sha: nil, quarantine: nil ) odie "Installing casks is supported only on macOS" unless OS.mac? = { verbose: verbose, force: force, binaries: binaries, skip_cask_deps: skip_cask_deps, require_sha: require_sha, quarantine: quarantine, }.compact [:quarantine] = true if [:quarantine].nil? require "cask/installer" casks.each do |cask| Installer.new(cask, **).install rescue CaskAlreadyInstalledError => e opoo e. end end |
.min_named ⇒ 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.
10 11 12 |
# File 'Library/Homebrew/cask/cmd/install.rb', line 10 def self.min_named :cask end |
.parser(&block) ⇒ 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.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'Library/Homebrew/cask/cmd/install.rb', line 24 def self.parser(&block) super do switch "--force", description: "Force overwriting existing files." OPTIONS.each do |option| send(*option) end instance_eval(&block) if block_given? end end |
Instance Method Details
#run ⇒ 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.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'Library/Homebrew/cask/cmd/install.rb', line 37 def run self.class.install_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 |