Class: Cask::DSL Private

Inherits:
Object show all
Includes:
Autobump::DSL, DeprecateDisable::DSL, Homepage::DSL, Livecheck::DSL, OS::Mac::Cask::DSL, OnSystem::MacOSAndLinux, Utils::Output::Mixin, Utils::Path
Defined in:
cask/dsl.rb,
cask/dsl/base.rb,
cask/dsl/rename.rb,
cask/dsl/caveats.rb,
cask/dsl/version.rb,
cask/dsl/container.rb,
cask/dsl/preflight.rb,
cask/dsl/depends_on.rb,
cask/dsl/postflight.rb,
cask/dsl/conflicts_with.rb,
cask/dsl/uninstall_preflight.rb,
cask/dsl/uninstall_postflight.rb,
sorbet/rbi/dsl/cask/dsl.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.

Class representing the domain-specific language used for casks.

Defined Under Namespace

Classes: Base, Caveats, ConflictsWith, Container, DependsOn, Postflight, Preflight, Rename, UninstallPostflight, UninstallPreflight, Version

Constant Summary collapse

ORDINARY_ARTIFACT_CLASSES =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[
  Artifact::Installer,
  Artifact::App,
  Artifact::AppImage,
  Artifact::Artifact,
  Artifact::AudioUnitPlugin,
  Artifact::Binary,
  Artifact::CommandWrapper,
  Artifact::Colorpicker,
  Artifact::Dictionary,
  Artifact::Font,
  Artifact::GeneratedScript,
  Artifact::InputMethod,
  Artifact::InternetPlugin,
  Artifact::KeyboardLayout,
  Artifact::Manpage,
  Artifact::Pkg,
  Artifact::Prefpane,
  Artifact::Qlplugin,
  Artifact::Mdimporter,
  Artifact::ScreenSaver,
  Artifact::Service,
  Artifact::StageOnly,
  Artifact::Suite,
  Artifact::VstPlugin,
  Artifact::Vst3Plugin,
  Artifact::BashCompletion,
  Artifact::ZshCompletion,
  Artifact::FishCompletion,
  Artifact::PwshCompletion,
  Artifact::GeneratedCompletion,
  Artifact::Uninstall,
  Artifact::Zap,
].freeze
ACTIVATABLE_ARTIFACT_CLASSES =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.let(activatable_artifact_classes.freeze, T::Array[T.class_of(Artifact::AbstractArtifact)])
ARTIFACT_BLOCK_CLASSES =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[
  Artifact::PreflightBlock,
  Artifact::PostflightBlock,
].freeze
INSTALL_STEP_ARTIFACT_CLASSES =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[
  Artifact::PreflightSteps,
  Artifact::PostflightSteps,
  Artifact::UninstallPreflightSteps,
  Artifact::UninstallPostflightSteps,
].freeze
ARTIFACT_DSL_METHODS =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.let(artifact_dsl_methods.freeze, T::Set[Symbol])
DSL_METHODS =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.let(Set.new([
  :arch,
  :artifacts,
  :auto_updates,
  :caveats,
  :conflicts_with,
  :container,
  :desc,
  :depends_on,
  :homepage,
  :homepage_browsed,
  :language,
  :name,
  :os,
  :rename,
  :sha256,
  :staged_path,
  :url,
  :version,
  :appdir,
  :deprecate!,
  :deprecated?,
  :deprecation_date,
  :deprecation_reason,
  :deprecation_replacement_cask,
  :deprecation_replacement_formula,
  :deprecate_args,
  :disable!,
  :disabled?,
  :disable_date,
  :disable_reason,
  :disable_replacement_cask,
  :disable_replacement_formula,
  :disable_args,
  :livecheck,
  :livecheck_defined?,
  :no_autobump!,
  :autobump?,
  :no_autobump_message,
  :on_system_blocks_exist?,
  :on_os_blocks_exist?,
  :on_system_block_min_os,
  :depends_on_set_in_block?,
  *ARTIFACT_DSL_METHODS,
]).freeze, T::Set[Symbol])

Instance Attribute Summary collapse

Attributes included from OnSystem::DSL

#on_system_block_min_os

Attributes included from Homepage::DSL

#homepage_browsed

Attributes included from DeprecateDisable::DSL

#deprecate_args, #deprecation_date, #deprecation_reason, #deprecation_replacement_cask, #deprecation_replacement_formula, #disable_args, #disable_date, #disable_reason, #disable_replacement_cask, #disable_replacement_formula

Attributes included from Autobump::DSL

#no_autobump_message

Instance Method Summary collapse

Methods included from OnSystem::DSL

#on_os_blocks_exist?, #on_system_blocks_exist?

Methods included from Livecheck::DSL

#livecheck_defined?

Methods included from DeprecateDisable::DSL

#deprecated?, #disabled?

Methods included from Autobump::DSL

#autobump?

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) ⇒ 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:



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'cask/dsl.rb', line 160

def initialize(cask)
  # NOTE: `:"@#{stanza}"` variables set by `set_unique_stanza` must be
  # initialized to `nil`.
  @arch = T.let(nil, T.nilable(String))
  @arch_set_in_block = T.let(false, T::Boolean)
  @artifacts = T.let(ArtifactSet.new, ArtifactSet)
  @auto_updates = T.let(nil, T.nilable(T::Boolean))
  @auto_updates_set_in_block = T.let(false, T::Boolean)
  @cask = cask
  @caveats = T.let(DSL::Caveats.new(cask), DSL::Caveats)
  @conflicts_with = T.let(nil, T.nilable(DSL::ConflictsWith))
  @container = T.let(nil, T.nilable(DSL::Container))
  @container_set_in_block = T.let(false, T::Boolean)
  @depends_on = T.let(DSL::DependsOn.new, DSL::DependsOn)
  @depends_on_set_in_block = T.let(false, T::Boolean)
  @desc = T.let(nil, T.nilable(String))
  @desc_set_in_block = T.let(false, T::Boolean)
  @homepage = T.let(nil, T.nilable(String))
  @homepage_set_in_block = T.let(false, T::Boolean)
  @language_blocks = T.let({}, T::Hash[T::Array[String], Proc])
  @language_eval = T.let(nil, T.nilable(String))
  @livecheck = T.let(Livecheck.new(cask), Livecheck)
  @name = T.let([], T::Array[String])
  @no_autobump_defined = T.let(false, T::Boolean)
  @os = T.let(nil, T.nilable(String))
  @os_set_in_block = T.let(false, T::Boolean)
  @rename = T.let([], T::Array[DSL::Rename])
  @sha256 = T.let(nil, T.nilable(T.any(Checksum, Symbol)))
  @sha256_set_in_block = T.let(false, T::Boolean)
  @staged_path = T.let(nil, T.nilable(Pathname))
  @token = T.let(cask.token, String)
  @url = T.let(nil, T.nilable(URL))
  @url_set_in_block = T.let(false, T::Boolean)
  @version = T.let(nil, T.nilable(DSL::Version))
  @version_set_in_block = T.let(false, T::Boolean)
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.anything)

Returns:

  • (T.noreturn)

Raises:

  • (NoMethodError)


784
785
786
# File 'cask/dsl.rb', line 784

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

Instance Attribute Details

#artifacts ⇒ ArtifactSet (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:



157
158
159
# File 'cask/dsl.rb', line 157

def artifacts
  @artifacts
end

#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:



151
152
153
# File 'cask/dsl.rb', line 151

def cask
  @cask
end

#token ⇒ String (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:



154
155
156
# File 'cask/dsl.rb', line 154

def token
  @token
end

Instance Method Details

#app(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def app(*args, **kwargs); end

#app_image(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def app_image(*args, **kwargs); end

#appdir ⇒ Pathname, String

The directory apps are installed into.

Returns:



802
803
804
805
806
# File 'cask/dsl.rb', line 802

def appdir
  return HOMEBREW_CASK_APPDIR_PLACEHOLDER if Cask.generating_hash?

  cask.config.appdir
end

#arch(arm: nil, intel: nil) ⇒ String?

Sets the cask's architecture strings.

Example

arch arm: "darwin-arm64", intel: "darwin"

Parameters:

  • arm (String, nil) (defaults to: nil)
  • intel (String, nil) (defaults to: nil)

Returns:



534
535
536
537
538
539
540
# File 'cask/dsl.rb', line 534

def arch(arm: nil, intel: nil)
  should_return = arm.nil? && intel.nil?

  set_unique_stanza(:arch, should_return) do
    on_arch_conditional(arm:, intel:)
  end
end

#artifact(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def artifact(*args, **kwargs); end

#audio_unit_plugin(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def audio_unit_plugin(*args, **kwargs); end

#auto_updates(auto_updates = nil) ⇒ Boolean?

Asserts that the cask artifacts auto-update.

Parameters:

  • auto_updates (Boolean, nil) (defaults to: nil)

Returns:

  • (Boolean, nil)


667
668
669
# File 'cask/dsl.rb', line 667

def auto_updates(auto_updates = nil)
  set_unique_stanza(:auto_updates, auto_updates.nil?) { auto_updates }
end

#bash_completion(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def bash_completion(*args, **kwargs); end

#binary(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def binary(*args, **kwargs); end

#caskroom_path ⇒ Pathname

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:



623
624
625
# File 'cask/dsl.rb', line 623

def caskroom_path
  cask.caskroom_path
end

#caveats(*strings, &block) ⇒ String, DSL::Caveats

Provide the user with cask-specific information at install time.

Parameters:

Returns:



647
648
649
650
651
652
653
654
655
656
657
658
# File 'cask/dsl.rb', line 647

def caveats(*strings, &block)
  if block
    @caveats.eval_caveats(&block)
  elsif strings.any?
    strings.each do |string|
      @caveats.eval_caveats { string }
    end
  else
    return @caveats.to_s
  end
  @caveats
end

#caveats_object ⇒ DSL::Caveats

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:



661
# File 'cask/dsl.rb', line 661

def caveats_object = @caveats

#colorpicker(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


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

def colorpicker(*args, **kwargs); end

#command_wrapper(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


31
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 31

def command_wrapper(*args, **kwargs); end

#conflicts_with(**kwargs) ⇒ DSL::ConflictsWith?

Note:

Multiple conflicts_with stanzas can be specified; they are merged.

Declare conflicts that keep a cask from installing or working correctly.

Parameters:

  • kwargs (T.anything)

Returns:



611
612
613
614
615
616
617
618
619
620
# File 'cask/dsl.rb', line 611

def conflicts_with(**kwargs)
  return @conflicts_with if kwargs.empty?

  new_conflicts = DSL::ConflictsWith.new(**kwargs)
  @conflicts_with = @conflicts_with&.merge!(new_conflicts) || new_conflicts
rescue CaskInvalidError
  raise
rescue => e
  raise CaskInvalidError.new(cask, "'conflicts_with' stanza failed with: #{e}")
end

#container(nested: nil, type: nil) ⇒ DSL::Container?

Sets the cask's container type or nested container path.

Examples

The container is a nested disk image:

container nested: "orca-#{version}.dmg"

The container should not be unarchived:

container type: :naked

Parameters:

  • nested (String, nil) (defaults to: nil)
  • type (Symbol, nil) (defaults to: nil)

Returns:



419
420
421
422
423
# File 'cask/dsl.rb', line 419

def container(nested: nil, type: nil)
  set_unique_stanza(:container, nested.nil? && type.nil?) do
    DSL::Container.new(nested:, type:)
  end
end

#default_language_group ⇒ Array<String>?

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:



352
353
354
355
356
357
# File 'cask/dsl.rb', line 352

def default_language_group
  default_language_block = @language_blocks.default
  return if default_language_block.nil?

  @language_blocks.key(default_language_block)
end

#depends_on(arg = nil, **kwargs) ⇒ DSL::DependsOn

Note:

Multiple dependencies can be specified.

Declare dependencies and requirements for a cask.

Parameters:

  • arg (Symbol, nil) (defaults to: nil)
  • kwargs (T.untyped)

Returns:



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'cask/dsl.rb', line 579

def depends_on(arg = nil, **kwargs)
  @depends_on_set_in_block = true if in_on_system_block?
  if arg == :macos
    if kwargs.key?(:macos) || kwargs.key?(:maximum_macos)
      raise CaskInvalidError.new(cask, "`depends_on :macos` cannot be combined with another macOS `depends_on`")
    end

    kwargs[:macos] = :any
  elsif arg == :linux
    kwargs[:linux] = :any
  elsif arg
    raise CaskInvalidError.new(cask, "invalid 'depends_on' value: #{arg.inspect}")
  end
  return @depends_on if kwargs.empty?

  begin
    # Only OS blocks scope a dependency to one OS: `on_arm`/`on_intel`
    # blocks are evaluated on every OS, so a macOS dependency inside one
    # applies everywhere and marks the cask macOS-only.
    @depends_on.load(kwargs, set_in_block: in_on_system_block?, os_scoped: in_on_os_block?)
  rescue RuntimeError, ArgumentError => e
    raise CaskInvalidError.new(cask, e)
  end
  @depends_on
end

#depends_on_set_in_block? ⇒ 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.

Returns:

  • (Boolean)


198
# File 'cask/dsl.rb', line 198

def depends_on_set_in_block? = @depends_on_set_in_block

#deprecate!(date:, because:, replacement: nil, replacement_formula: nil, replacement_cask: nil) ⇒ void

Note:

A warning will be shown when trying to install this cask.

This method returns an undefined value.

Declare that a cask is no longer functional or supported.

Parameters:

  • date (String)
  • because (String, Symbol)
  • replacement (String, nil) (defaults to: nil)
  • replacement_formula (String, nil) (defaults to: nil)
  • replacement_cask (String, nil) (defaults to: nil)


719
720
721
# File 'cask/dsl.rb', line 719

def deprecate!(date:, because:, replacement: nil, replacement_formula: nil, replacement_cask: nil)
  set_deprecation(date:, because:, replacement:, replacement_formula:, replacement_cask:)
end

#desc(description = nil) ⇒ String?

Describes the cask.

Example

desc "Open-source code editor"

Parameters:

  • description (String, nil) (defaults to: nil)

Returns:

See Also:



229
230
231
# File 'cask/dsl.rb', line 229

def desc(description = nil)
  set_unique_stanza(:desc, description.nil?) { description }
end

#dictionary(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


34
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 34

def dictionary(*args, **kwargs); end

#disable!(date:, because:, replacement: nil, replacement_formula: nil, replacement_cask: nil) ⇒ void

Note:

An error will be thrown when trying to install this cask.

This method returns an undefined value.

Declare that a cask is no longer functional or supported.

Parameters:

  • date (String)
  • because (String, Symbol)
  • replacement (String, nil) (defaults to: nil)
  • replacement_formula (String, nil) (defaults to: nil)
  • replacement_cask (String, nil) (defaults to: nil)


737
738
739
740
741
742
# File 'cask/dsl.rb', line 737

def disable!(date:, because:, replacement: nil, replacement_formula: nil, replacement_cask: nil)
  # odeprecate: remove this remapping when the :unsigned reason is removed
  because = :fails_gatekeeper_check if because == :unsigned

  set_disable(date:, because:, replacement:, replacement_formula:, replacement_cask:)
end

#fish_completion(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


37
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 37

def fish_completion(*args, **kwargs); end

#font(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


40
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 40

def font(*args, **kwargs); end

#generate_completions_from_executable(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


43
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 43

def generate_completions_from_executable(*args, **kwargs); end

#generated_script(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


46
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 46

def generated_script(*args, **kwargs); end

#homepage(url = nil, browsed: nil) ⇒ String?

Sets the cask's homepage.

Example

homepage "https://code.visualstudio.com/", browsed: "2026-07-26"

browsed is the date when a human last checked the homepage in a browser. Automated homepage availability audits are skipped for one year.

Parameters:

  • url (String, nil) (defaults to: nil)
  • browsed (String, nil) (defaults to: nil)

Returns:



276
277
278
279
280
281
282
# File 'cask/dsl.rb', line 276

def homepage(url = nil, browsed: nil)
  return super unless url

  set_unique_stanza(:homepage, false) { super }
rescue ArgumentError => e
  raise CaskInvalidError.new(cask, e)
end

#input_method(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


49
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 49

def input_method(*args, **kwargs); end

#installer(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


52
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 52

def installer(*args, **kwargs); end

#internet_plugin(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


55
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 55

def internet_plugin(*args, **kwargs); end

#keyboard_layout(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


58
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 58

def keyboard_layout(*args, **kwargs); end

#language(*args, default: false, &block) ⇒ String?

Specifies language-specific values for the cask.

Parameters:

  • args (String)
  • default (Boolean) (defaults to: false)
  • block (T.proc.returns(String), nil)

Returns:



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'cask/dsl.rb', line 294

def language(*args, default: false, &block)
  if args.empty?
    language_eval
  elsif block
    @language_blocks[args] = block

    return unless default

    if !@cask.allow_reassignment && @language_blocks.default.present?
      raise CaskInvalidError.new(cask, "Only one default language may be defined.")
    end

    @language_blocks.default = block
    nil
  else
    raise CaskInvalidError.new(cask, "No block given to language stanza.")
  end
end

#language_eval ⇒ String?

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:



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'cask/dsl.rb', line 314

def language_eval
  return @language_eval unless @language_eval.nil?

  return @language_eval = nil if @language_blocks.empty?

  if (language_blocks_default = @language_blocks.default).nil?
    raise CaskInvalidError.new(cask, "No default language specified.")
  end

  locales = cask.config
                .languages
                .filter_map do |language|
                  Locale.parse(language)
                rescue Locale::ParserError
                  nil
                end

  locales.each do |locale|
    key = T.cast(locale.detect(@language_blocks.keys), T.nilable(T::Array[String]))
    next if key.nil? || (language_block = @language_blocks[key]).nil?

    return @language_eval = language_block.call
  end

  @language_eval = language_blocks_default.call
end

#language_groups ⇒ Array<Array<String>>

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:



347
348
349
# File 'cask/dsl.rb', line 347

def language_groups
  @language_blocks.keys
end

#languages ⇒ Array<String>

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:



342
343
344
# File 'cask/dsl.rb', line 342

def languages
  @language_blocks.keys.flatten
end

#livecheck(&block) ⇒ Livecheck

Automatically fetch the latest version of a cask from changelogs.

Parameters:

Returns:



675
676
677
678
679
680
681
682
683
684
685
# File 'cask/dsl.rb', line 675

def livecheck(&block)
  return @livecheck unless block

  if !@cask.allow_reassignment && livecheck_defined?
    raise CaskInvalidError.new(cask, "'livecheck' stanza may only appear once.")
  end

  configure_livecheck(@livecheck, &block)
  set_no_autobump(because: :extract_plist) if @livecheck.strategy == :extract_plist && autobump?
  @livecheck
end

#manpage(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


61
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 61

def manpage(*args, **kwargs); end

#mdimporter(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


64
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 64

def mdimporter(*args, **kwargs); end

#name(*args) ⇒ Array<String>

Note:

Multiple names can be specified.

Specifies the cask's name.

Example

name "Visual Studio Code"

Parameters:

Returns:



212
213
214
215
216
# File 'cask/dsl.rb', line 212

def name(*args)
  return @name if args.empty?

  @name.concat(args.flatten)
end

#no_autobump!(because:) ⇒ void

This method returns an undefined value.

Excludes the cask from autobump list.

Parameters:



691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'cask/dsl.rb', line 691

def no_autobump!(because:)
  tap = @cask.tap
  if tap && !tap.official?
    raise CaskInvalidError.new(cask, "'no_autobump!' can only be used in official Homebrew taps.")
  end

  if !@cask.allow_reassignment && @no_autobump_defined
    raise CaskInvalidError.new(cask, "'no_autobump!' stanza may only appear once.")
  end

  set_no_autobump(because:, from_metadata: @cask.loaded_from_metadata?)
  @no_autobump_defined = true
end

#on_arch_conditional(arm: nil, intel: nil) ⇒ T.type_parameter(:U)?

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:

  • arm (T.type_parameter(:U), nil) (defaults to: nil)
  • intel (T.type_parameter(:U), nil) (defaults to: nil)

Returns:

  • (T.type_parameter(:U), nil)


73
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 73

def on_arch_conditional(arm: nil, intel: nil); end

#on_arm(&block) ⇒ T.type_parameter(:U)?

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:

  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


81
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 81

def on_arm(&block); end

#on_big_sur(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


90
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 90

def on_big_sur(or_condition = nil, &block); end

#on_golden_gate(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


99
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 99

def on_golden_gate(or_condition = nil, &block); end

#on_intel(&block) ⇒ T.type_parameter(:U)?

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:

  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


107
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 107

def on_intel(&block); end

#on_linux(&block) ⇒ T.type_parameter(:U)?

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:

  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


115
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 115

def on_linux(&block); end

#on_macos(&block) ⇒ T.type_parameter(:U)?

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:

  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


123
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 123

def on_macos(&block); end

#on_monterey(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


132
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 132

def on_monterey(or_condition = nil, &block); end

#on_sequoia(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


141
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 141

def on_sequoia(or_condition = nil, &block); end

#on_sonoma(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


150
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 150

def on_sonoma(or_condition = nil, &block); end

#on_system(linux, macos:, &block) ⇒ T.type_parameter(:U)?

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:

  • linux (Symbol)
  • macos (Symbol)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


160
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 160

def on_system(linux, macos:, &block); end

#on_system_conditional(macos: nil, linux: nil) ⇒ T.type_parameter(:U)?

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:

  • macos (T.type_parameter(:U), nil) (defaults to: nil)
  • linux (T.type_parameter(:U), nil) (defaults to: nil)

Returns:

  • (T.type_parameter(:U), nil)


169
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 169

def on_system_conditional(macos: nil, linux: nil); end

#on_tahoe(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


178
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 178

def on_tahoe(or_condition = nil, &block); end

#on_ventura(or_condition = nil, &block) ⇒ T.type_parameter(:U)?

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:

  • or_condition (Symbol, nil) (defaults to: nil)
  • block (T.proc.returns(T.type_parameter(:U)))

Returns:

  • (T.type_parameter(:U), nil)


187
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 187

def on_ventura(or_condition = nil, &block); end

#os(macos: nil, linux: nil) ⇒ String?

Sets the cask's os strings.

Example

os macos: "darwin", linux: "tux"

Parameters:

  • macos (String, nil) (defaults to: nil)
  • linux (String, nil) (defaults to: nil)

Returns:



557
558
559
560
561
562
563
564
565
# File 'cask/dsl.rb', line 557

def os(macos: nil, linux: nil)
  should_return = macos.nil? && linux.nil?

  set_unique_stanza(:os, should_return) do
    mark_on_system_block(os: true)

    on_system_conditional(macos:, linux:)
  end
end

#os_version ⇒ MacOSVersion?

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:



794
795
796
# File 'cask/dsl.rb', line 794

def os_version
  nil
end

#pkg(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


190
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 190

def pkg(*args, **kwargs); end

#postflight(&block) ⇒ 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.

This method returns an undefined value.

Parameters:



193
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 193

def postflight(&block); end

#postflight_steps(steps = nil, **kwargs, &block) ⇒ 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.

This method returns an undefined value.

Parameters:



202
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 202

def postflight_steps(steps = nil, **kwargs, &block); end

#preflight(&block) ⇒ 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.

This method returns an undefined value.

Parameters:



205
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 205

def preflight(&block); end

#preflight_steps(steps = nil, **kwargs, &block) ⇒ 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.

This method returns an undefined value.

Parameters:



214
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 214

def preflight_steps(steps = nil, **kwargs, &block); end

#prefpane(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


217
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 217

def prefpane(*args, **kwargs); end

#pwsh_completion(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


220
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 220

def pwsh_completion(*args, **kwargs); end

#qlplugin(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


223
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 223

def qlplugin(*args, **kwargs); end

#rename(from = nil, to = nil) ⇒ Array<DSL::Rename>

Renames files after extraction.

This is useful when the downloaded file has unpredictable names that need to be normalized for proper artifact installation.

Example

rename "RØDECaster App*.pkg", "RØDECaster App.pkg"

Parameters:

  • from (String, nil) (defaults to: nil)
  • to (String, nil) (defaults to: nil)

Returns:

Raises:



438
439
440
441
442
443
# File 'cask/dsl.rb', line 438

def rename(from = nil, to = nil)
  return @rename if from.nil?
  raise CaskInvalidError.new(cask, "`rename` requires both a `from` and a `to` filename") if to.nil?

  @rename << DSL::Rename.new(from, to)
end

#respond_to_missing?(_method_name, _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_name (String, Symbol)
  • _include_private (Boolean) (defaults to: false)

Returns:

  • (Boolean)


789
790
791
# File 'cask/dsl.rb', line 789

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

#screen_saver(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


226
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 226

def screen_saver(*args, **kwargs); end

#service(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


229
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 229

def service(*args, **kwargs); end

#set_unique_stanza(stanza, should_return, &_block) ⇒ T.type_parameter(:U)

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.

Note:

Using WithoutRuntime to avoid Sorbet wrapping this method,

which would interfere with caller_locations in methods like url.

Parameters:

  • stanza (Symbol)
  • should_return (Boolean)
  • _block (T.proc.returns(T.all(BasicObject, T.type_parameter(:U))))

Returns:

  • (T.type_parameter(:U))


242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'cask/dsl.rb', line 242

def set_unique_stanza(stanza, should_return, &_block)
  return instance_variable_get(:"@#{stanza}") if should_return

  unless @cask.allow_reassignment
    if !instance_variable_get(:"@#{stanza}").nil? && !in_on_system_block?
      raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only appear once.")
    end

    if instance_variable_get(:"@#{stanza}_set_in_block") && in_on_system_block?
      raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only be overridden once.")
    end
  end

  instance_variable_set(:"@#{stanza}_set_in_block", true) if in_on_system_block?
  instance_variable_set(:"@#{stanza}", yield)
rescue CaskInvalidError
  raise
rescue => e
  raise CaskInvalidError.new(cask, "'#{stanza}' stanza failed with: #{e}")
end

#sha256(arg = nil, arm: nil, intel: nil, x86_64: nil, x86_64_linux: nil, arm64_linux: nil) ⇒ Symbol, ...

Sets the cask's download checksum.

Example

For universal or single-architecture downloads:

sha256 "7bdb497080ffafdfd8cc94d8c62b004af1be9599e865e5555e456e2681e150ca"

For architecture- or OS-dependent downloads:

sha256 arm:          "7bdb497080ffafdfd8cc94d8c62b004af1be9599e865e5555e456e2681e150ca",
       intel:        "b3c1c2442480a0219b9e05cf91d03385858c20f04b764ec08a3fa83d1b27e7b2",
       arm64_linux:  "bd766af7e692afceb727a6f88e24e6e68d9882aeb3e8348412f6c03d96537c75",
       x86_64_linux: "1a2aee7f1ddc999993d4d7d42a150c5e602bc17281678050b8ed79a0500cc90f"

Parameters:

  • arg (String, Symbol, nil) (defaults to: nil)
  • arm (String, nil) (defaults to: nil)
  • intel (String, nil) (defaults to: nil)
  • x86_64 (String, nil) (defaults to: nil)
  • x86_64_linux (String, nil) (defaults to: nil)
  • arm64_linux (String, nil) (defaults to: nil)

Returns:



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
# File 'cask/dsl.rb', line 498

def sha256(arg = nil, arm: nil, intel: nil, x86_64: nil, x86_64_linux: nil, arm64_linux: nil)
  should_return = arg.nil? && arm.nil? && intel.nil? && x86_64.nil? && x86_64_linux.nil? && arm64_linux.nil?

  x86_64 ||= intel if intel.present? && x86_64.nil?
  set_unique_stanza(:sha256, should_return) do
    if arm.present? || x86_64.present? || x86_64_linux.present? || arm64_linux.present?
      mark_on_system_block
    end

    val = arg || on_system_conditional(
      macos: on_arch_conditional(arm:, intel: x86_64),
      linux: on_arch_conditional(arm: arm64_linux, intel: x86_64_linux),
    )
    case val
    when :no_check
      :no_check
    when String
      Checksum.new(val)
    when nil
      nil
    else
      raise CaskInvalidError.new(cask, "invalid 'sha256' value: #{val.inspect}")
    end
  end
end

#stage_only(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


232
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 232

def stage_only(*args, **kwargs); end

#staged_path ⇒ Pathname

The staged location for this cask, including version number.

Returns:



631
632
633
634
635
636
# File 'cask/dsl.rb', line 631

def staged_path
  return @staged_path if @staged_path

  cask_version = version || :unknown
  @staged_path = caskroom_path.join(cask_version.to_s)
end

#suite(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


235
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 235

def suite(*args, **kwargs); end

#uninstall(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


238
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 238

def uninstall(*args, **kwargs); end

#uninstall_postflight(&block) ⇒ 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.

This method returns an undefined value.

Parameters:



245
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 245

def uninstall_postflight(&block); end

#uninstall_postflight_steps(steps = nil, **kwargs, &block) ⇒ 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.

This method returns an undefined value.

Parameters:



254
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 254

def uninstall_postflight_steps(steps = nil, **kwargs, &block); end

#uninstall_preflight(&block) ⇒ 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.

This method returns an undefined value.

Parameters:



261
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 261

def uninstall_preflight(&block); end

#uninstall_preflight_steps(steps = nil, **kwargs, &block) ⇒ 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.

This method returns an undefined value.

Parameters:



270
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 270

def uninstall_preflight_steps(steps = nil, **kwargs, &block); end

#url(uri = nil, verified: nil, using: nil, tag: nil, branch: nil, revisions: nil, revision: nil, trust_cert: nil, cookies: nil, referer: nil, header: nil, user_agent: nil, data: nil, only_path: nil) ⇒ URL?

Deprecated.

Calling the verified parameter in the url stanza is deprecated, use the default URL verification behaviour instead.

Sets the cask's download URL.

Example

url "https://update.code.visualstudio.com/#{version}/#{arch}/stable"

Parameters:

Returns:



386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'cask/dsl.rb', line 386

def url(uri = nil, verified: nil, using: nil, tag: nil, branch: nil, revisions: nil, revision: nil,
        trust_cert: nil, cookies: nil, referer: nil, header: nil, user_agent: nil, data: nil, only_path: nil)
  caller_location = caller_locations.fetch(0)
  return @url unless uri

  if verified && !@cask.loaded_from_api?
    odeprecated "the `verified` parameter in the `url` stanza", "the default URL verification behaviour"
  end

  set_unique_stanza(:url, false) do
    URL.new(uri, using:, tag:, branch:, revisions:, revision:, trust_cert:, cookies:, referer:, header:,
            user_agent:, data:, only_path:, caller_location:)
  end
end

#version(arg = nil) ⇒ DSL::Version?

Sets the cask's version.

Example

version "1.88.1"

Parameters:

Returns:

See Also:



456
457
458
459
460
461
462
463
464
465
466
# File 'cask/dsl.rb', line 456

def version(arg = nil)
  set_unique_stanza(:version, arg.nil?) do
    if !arg.is_a?(String) && arg != :latest
      raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}")
    end

    version = DSL::Version.new(arg)
    set_no_autobump(because: :latest_version) if version.latest? && autobump?
    version
  end
end

#vst3_plugin(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


273
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 273

def vst3_plugin(*args, **kwargs); end

#vst_plugin(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


276
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 276

def vst_plugin(*args, **kwargs); end

#zap(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


279
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 279

def zap(*args, **kwargs); end

#zsh_completion(*args, **kwargs) ⇒ 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.

This method returns an undefined value.

Parameters:

  • args (T.anything)
  • kwargs (T.anything)


282
# File 'sorbet/rbi/dsl/cask/dsl.rbi', line 282

def zsh_completion(*args, **kwargs); end