Class: Cask::DSL::Base Private

Inherits:
Object show all
Extended by:
Forwardable
Includes:
Utils::Path
Defined in:
cask/dsl/base.rb,
sorbet/rbi/dsl/cask/dsl/base.rbi

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.

Superclass for all stanzas which take a block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Path

formula_installed_prefixes, formula_opt_bin_env, formula_opt_bin_path, install_info, loadable_package_path?, tap_package_path, uninstall_info, valid_package_name?

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_once, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_incompatible, #pretty_install_status, #pretty_installed, #pretty_removed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning

Methods included from Utils::Path::Helpers

#child_of?, #cp_path_sub, #ensure_child_of!, #ensure_writable, #relative_path_from, #resolved_path, #resolved_path_exists?, #rmdir_if_possible, #text_executable?

Methods included from Utils::Path::FormulaHelpers

#formula_any_version_installed?, #formula_opt_bin, #formula_opt_include, #formula_opt_lib, #formula_opt_libexec, #formula_opt_prefix

Constructor Details

#initialize(cask, command = SystemCommand) ⇒ void

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.

Parameters:



20
21
22
23
# File 'cask/dsl/base.rb', line 20

def initialize(cask, command = SystemCommand)
  @cask = cask
  @command = command
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *_args) ⇒ T.noreturn

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.

Parameters:

  • method (Symbol)
  • _args (T.untyped)

Returns:

  • (T.noreturn)

Raises:

  • (NoMethodError)


53
54
55
# File 'cask/dsl/base.rb', line 53

def method_missing(method, *_args)
  raise NoMethodError, "undefined method '#{method}' for Cask '#{@cask}'"
end

Instance Attribute Details

#cask ⇒ Cask (readonly)

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.

Returns:



14
15
16
# File 'cask/dsl/base.rb', line 14

def cask
  @cask
end

#command ⇒ T.class_of(SystemCommand) (readonly)

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.

Returns:



17
18
19
# File 'cask/dsl/base.rb', line 17

def command
  @command
end

Instance Method Details

#appdir(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


10
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 10

def appdir(*args, &block); end

#arch(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


13
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 13

def arch(*args, &block); end

#caskroom_path(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


16
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 16

def caskroom_path(*args, &block); end

#language(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


19
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 19

def language(*args, &block); end

#respond_to_missing?(_method, _include_private = false) ⇒ Boolean

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.

Parameters:

  • _method (Symbol)
  • _include_private (Boolean) (defaults to: false)

Returns:

  • (Boolean)


58
59
60
# File 'cask/dsl/base.rb', line 58

def respond_to_missing?(_method, _include_private = false)
  false
end

#staged_path(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


22
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 22

def staged_path(*args, &block); end

#system_command(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], must_succeed: true, print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) ⇒ SystemCommand::Result?

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.

Parameters:

  • executable (String)
  • args (Array<String, Integer, Float, Pathname>) (defaults to: [])
  • sudo (Boolean, nil) (defaults to: false)
  • sudo_as_root (Boolean) (defaults to: false)
  • env (Hash{String => String, Boolean, PATH, nil}) (defaults to: {})
  • input (String, Array<String>) (defaults to: [])
  • must_succeed (Boolean) (defaults to: true)
  • print_stdout (Boolean, Symbol) (defaults to: false)
  • print_stderr (Boolean, Symbol) (defaults to: true)
  • debug (Boolean, nil) (defaults to: nil)
  • verbose (Boolean, nil) (defaults to: nil)
  • secrets (String, Array<String>) (defaults to: [])
  • chdir (String, Pathname, nil) (defaults to: nil)
  • timeout (Integer, Float, nil) (defaults to: nil)

Returns:



45
46
47
48
49
50
# File 'cask/dsl/base.rb', line 45

def system_command(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [],
                   must_succeed: true, print_stdout: false, print_stderr: true, debug: nil, verbose: nil,
                   secrets: [], chdir: nil, timeout: nil)
  @command.run!(executable, args:, sudo:, sudo_as_root:, env:, input:, must_succeed:, print_stdout:,
                print_stderr:, debug:, verbose:, secrets:, chdir:, timeout:)
end

#token(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


25
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 25

def token(*args, &block); end

#version(*args, &block) ⇒ T.untyped

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.

Parameters:

  • args (T.untyped)
  • block (T.untyped)

Returns:

  • (T.untyped)


28
# File 'sorbet/rbi/dsl/cask/dsl/base.rbi', line 28

def version(*args, &block); end