Class: Cask::Cask Private

Inherits:
Object show all
Extended by:
APIHashable, Forwardable, Utils::Output::Mixin
Includes:
Metadata
Defined in:
cask/cask.rb,
sorbet/rbi/dsl/cask/cask.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.

An instance of a cask.

Constant Summary

Constants included from Metadata

Metadata::METADATA_SUBDIR, Metadata::TIMESTAMP_FORMAT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIHashable

deep_remove_placeholders, generated_hash!, generating_hash!, generating_hash?

Methods included from Utils::Output::Mixin

odebug, odeprecated, odie, odisabled, ofail, oh1, oh1_title, ohai, ohai_title, onoe, opoo, opoo_outside_github_actions, pretty_deprecated, pretty_disabled, pretty_duration, pretty_installed, pretty_outdated, pretty_uninstalled

Methods included from Metadata

#metadata_main_container_path, #metadata_subdir, #metadata_timestamped_path, #metadata_versioned_path

Constructor Details

#initialize(token, sourcefile_path: nil, source: nil, tap: nil, loaded_from_api: false, loaded_from_internal_api: false, api_source: nil, config: nil, allow_reassignment: false, loader: nil, &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.

Parameters:

  • token (String)
  • sourcefile_path (Pathname, nil) (defaults to: nil)
  • source (String, nil) (defaults to: nil)
  • tap (Tap, nil) (defaults to: nil)
  • loaded_from_api (Boolean) (defaults to: false)
  • loaded_from_internal_api (Boolean) (defaults to: false)
  • api_source (Hash{String => T.untyped}, nil) (defaults to: nil)
  • config (Config, nil) (defaults to: nil)
  • allow_reassignment (Boolean) (defaults to: false)
  • loader (CaskLoader::ILoader, nil) (defaults to: nil)
  • block (T.proc.bind(DSL).void, nil)


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'cask/cask.rb', line 73

def initialize(token, sourcefile_path: nil, source: nil, tap: nil, loaded_from_api: false,
               loaded_from_internal_api: false, api_source: nil, config: nil, allow_reassignment: false,
               loader: nil, &block)
  @token = token
  @sourcefile_path = sourcefile_path
  @source = source
  @tap = tap
  @allow_reassignment = allow_reassignment
  @loaded_from_api = loaded_from_api
  @loaded_from_internal_api = loaded_from_internal_api
  @api_source = api_source
  @loader = loader
  # Sorbet has trouble with bound procs assigned to instance variables:
  # https://github.com/sorbet/sorbet/issues/6843
  instance_variable_set(:@block, block)

  @default_config = config || Config.new

  self.config = if config_path.exist?
    Config.from_json(File.read(config_path), ignore_invalid_keys: true)
  else
    @default_config
  end
end

Instance Attribute Details

#allow_reassignmentObject

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.



33
34
35
# File 'cask/cask.rb', line 33

def allow_reassignment
  @allow_reassignment
end

#api_sourceHash{String => T.untyped}? (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:



105
106
107
# File 'cask/cask.rb', line 105

def api_source
  @api_source
end

#configObject

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The configuration of this Cask::Cask.



30
31
32
# File 'cask/cask.rb', line 30

def config
  @config
end

#default_configObject (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.



32
33
34
# File 'cask/cask.rb', line 32

def default_config
  @default_config
end

#downloadObject

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.



33
34
35
# File 'cask/cask.rb', line 33

def download
  @download
end

#loaderObject (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.



32
33
34
# File 'cask/cask.rb', line 32

def loader
  @loader
end

#sourceObject (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.



32
33
34
# File 'cask/cask.rb', line 32

def source
  @source
end

#sourcefile_pathObject (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.



32
33
34
# File 'cask/cask.rb', line 32

def sourcefile_path
  @sourcefile_path
end

#tokenObject (readonly)

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The token of this Cask::Cask.



25
26
27
# File 'cask/cask.rb', line 25

def token
  @token
end

Class Method Details

.all(eval_all: false) ⇒ 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.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'cask/cask.rb', line 35

def self.all(eval_all: false)
  if !eval_all && !Homebrew::EnvConfig.eval_all?
    raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or `HOMEBREW_EVAL_ALL=1`"
  end

  # Load core casks from tokens so they load from the API when the core cask is not tapped.
  tokens_and_files = CoreCaskTap.instance.cask_tokens
  tokens_and_files += Tap.reject(&:core_cask_tap?).flat_map(&:cask_files)
  tokens_and_files.filter_map do |token_or_file|
    CaskLoader.load(token_or_file)
  rescue CaskUnreadableError => e
    opoo e.message

    nil
  end
end

Instance Method Details

#app(*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/cask.rbi', line 10

def app(*args, &block); end

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


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

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)


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

def arch(*args, &block); end

#artifact(*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/cask.rbi', line 19

def artifact(*args, &block); end

#artifacts(*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/cask.rbi', line 22

def artifacts(*args, &block); end

#artifacts_list(uninstall_only: false) ⇒ 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.



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'cask/cask.rb', line 516

def artifacts_list(uninstall_only: false)
  artifacts.filter_map do |artifact|
    case artifact
    when Artifact::AbstractFlightBlock
      uninstall_flight_block = artifact.directives.key?(:uninstall_preflight) ||
                               artifact.directives.key?(:uninstall_postflight)
      next if uninstall_only && !uninstall_flight_block

      # Only indicate whether this block is used as we don't load it from the API
      { artifact.summarize.to_sym => nil }
    else
      zap_artifact = artifact.is_a?(Artifact::Zap)
      uninstall_artifact = artifact.respond_to?(:uninstall_phase) || artifact.respond_to?(:post_uninstall_phase)
      next if uninstall_only && !zap_artifact && !uninstall_artifact

      { artifact.class.dsl_key => artifact.to_args }
    end
  end
end

#audio_unit_plugin(*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/cask.rbi', line 25

def audio_unit_plugin(*args, &block); end

#auto_updates(*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/cask.rbi', line 28

def auto_updates(*args, &block); end

#autobump?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def autobump?(*args, &block); end

#bash_completion(*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)


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

def bash_completion(*args, &block); end

#binary(*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)


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

def binary(*args, &block); end

#bundle_long_versionString?

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:



283
284
285
# File 'cask/cask.rb', line 283

def bundle_long_version
  bundle_version&.version
end

#bundle_short_versionString?

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:



278
279
280
# File 'cask/cask.rb', line 278

def bundle_short_version
  bundle_version&.short_version
end

#caskfile_only?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.

The caskfile is needed during installation when there are *flight blocks or the cask has multiple languages

Returns:

  • (Boolean)


221
222
223
# File 'cask/cask.rb', line 221

def caskfile_only?
  languages.any? || artifacts.any?(Artifact::AbstractFlightBlock)
end

#caskroom_pathPathname

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:



322
323
324
# File 'cask/cask.rb', line 322

def caskroom_path
  @caskroom_path ||= Caskroom.path.join(token)
end

#caveats(*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)


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

def caveats(*args, &block); end

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



138
# File 'cask/cask.rb', line 138

def caveats_object = @dsl.caveats_object

#checksumable?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)


295
296
297
298
299
# File 'cask/cask.rb', line 295

def checksumable?
  return false if (url = self.url).nil?

  DownloadStrategyDetector.detect(url.to_s, url.using) <= AbstractFileDownloadStrategy
end

#colorpicker(*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)


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

def colorpicker(*args, &block); end

#config_pathObject

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.



291
292
293
# File 'cask/cask.rb', line 291

def config_path
  /"config.json"
end

#conflicts_with(*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)


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

def conflicts_with(*args, &block); end

#container(*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)


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

def container(*args, &block); end

#contains_os_specific_artifacts?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)


192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'cask/cask.rb', line 192

def contains_os_specific_artifacts?
  return false unless @dsl.on_system_blocks_exist?

  any_loaded = T.let(false, T::Boolean)
  @contains_os_specific_artifacts ||= begin
    OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
      Homebrew::SimulateSystem.with_tag(bottle_tag) do
        refresh

        any_loaded = true if artifacts.any? do |artifact|
          (bottle_tag.linux? && ::Cask::Artifact::MACOS_ONLY_ARTIFACTS.include?(artifact.class)) ||
          (bottle_tag.macos? && ::Cask::Artifact::LINUX_ONLY_ARTIFACTS.include?(artifact.class))
        end
      end
    rescue CaskInvalidError
      # Invalid for this OS/arch tag; treat as having no OS-specific artifacts.
      next
    ensure
      refresh
    end

    any_loaded
  end

  @contains_os_specific_artifacts
end

#depends_on(*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)


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

def depends_on(*args, &block); end

#depends_on_set_in_block?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def depends_on_set_in_block?(*args, &block); end

#deprecate!(*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)


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

def deprecate!(*args, &block); end

#deprecate_args(*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)


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

def deprecate_args(*args, &block); end

#deprecated?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def deprecated?(*args, &block); end

#deprecation_date(*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)


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

def deprecation_date(*args, &block); end

#deprecation_reason(*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)


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

def deprecation_reason(*args, &block); end

#deprecation_replacement_cask(*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)


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

def deprecation_replacement_cask(*args, &block); end

#deprecation_replacement_formula(*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)


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

def deprecation_replacement_formula(*args, &block); end

#desc(*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)


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

def desc(*args, &block); end

#dictionary(*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)


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

def dictionary(*args, &block); end

#disable!(*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)


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

def disable!(*args, &block); end

#disable_args(*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)


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

def disable_args(*args, &block); end

#disable_date(*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)


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

def disable_date(*args, &block); end

#disable_reason(*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)


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

def disable_reason(*args, &block); end

#disable_replacement_cask(*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)


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

def disable_replacement_cask(*args, &block); end

#disable_replacement_formula(*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)


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

def disable_replacement_formula(*args, &block); end

#disabled?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def disabled?(*args, &block); end

#download_sha_pathObject

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.



301
302
303
# File 'cask/cask.rb', line 301

def download_sha_path
  /"LATEST_DOWNLOAD_SHA256"
end

#fish_completion(*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)


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

def fish_completion(*args, &block); end

#font(*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)


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

def font(*args, &block); end

#font?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)


171
172
173
# File 'cask/cask.rb', line 171

def font?
  artifacts.all?(Artifact::Font)
end

#full_nameObject

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Alias for #full_token.



163
# File 'cask/cask.rb', line 163

def full_name = full_token

#full_tokenObject

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The fully-qualified token of this Cask::Cask.



153
154
155
156
157
158
# File 'cask/cask.rb', line 153

def full_token
  return token if tap.nil?
  return token if tap.core_cask_tap?

  "#{tap.name}/#{token}"
end

#generate_completions_from_executable(*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)


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

def generate_completions_from_executable(*args, &block); end

#homepage(*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)


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

def homepage(*args, &block); end

#input_method(*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)


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

def input_method(*args, &block); end

#install_timeTime?

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:



237
238
239
240
241
# File 'cask/cask.rb', line 237

def install_time
  # <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
  caskfile = installed_caskfile
  Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile
end

#installed?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)


166
167
168
# File 'cask/cask.rb', line 166

def installed?
  installed_caskfile&.exist? || false
end

#installed_caskfilePathname?

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:



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'cask/cask.rb', line 244

def installed_caskfile
  installed_caskroom_path = caskroom_path
  installed_token = token

  # Check if the cask is installed with an old name.
  old_tokens.each do |old_token|
    old_caskroom_path = Caskroom.path/old_token
    next if !old_caskroom_path.directory? || old_caskroom_path.symlink?

    installed_caskroom_path = old_caskroom_path
    installed_token = old_token
    break
  end

  installed_version = timestamped_versions(caskroom_path: installed_caskroom_path).last
  return unless installed_version

  caskfile_dir = (caskroom_path: installed_caskroom_path)
                 .join(*installed_version, "Casks")

  ["internal.json", "json", "rb"]
    .map { |ext| caskfile_dir.join("#{installed_token}.#{ext}") }
    .find(&:exist?)
end

#installed_versionString?

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:



270
271
272
273
274
275
# File 'cask/cask.rb', line 270

def installed_version
  return unless (installed_caskfile = self.installed_caskfile)

  # <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <version>
  installed_caskfile.dirname.dirname.dirname.basename.to_s
end

#installer(*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)


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

def installer(*args, &block); end

#internet_plugin(*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)


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

def internet_plugin(*args, &block); end

#keyboard_layout(*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)


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

def keyboard_layout(*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)


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

def language(*args, &block); end

#languagesObject

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.



385
386
387
# File 'cask/cask.rb', line 385

def languages
  @languages ||= @dsl.languages
end

#livecheck(*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)


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

def livecheck(*args, &block); end

#livecheck_defined?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def livecheck_defined?(*args, &block); end

#loaded_from_api?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)


99
# File 'cask/cask.rb', line 99

def loaded_from_api? = @loaded_from_api

#loaded_from_internal_api?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)


102
# File 'cask/cask.rb', line 102

def loaded_from_internal_api? = @loaded_from_internal_api

#manpage(*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)


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

def manpage(*args, &block); end

#mdimporter(*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)


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

def mdimporter(*args, &block); end

#name(*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)


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

def name(*args, &block); end

#new_download_shaObject

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.



305
306
307
308
309
310
311
312
# File 'cask/cask.rb', line 305

def new_download_sha
  require "cask/installer"

  # Call checksumable? before hashing
  @new_download_sha ||= Installer.new(self, verify_download_integrity: false)
                                 .download(quiet: true)
                                 .instance_eval { |x| Digest::SHA256.file(x).hexdigest }
end

#no_autobump!(*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)


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

def no_autobump!(*args, &block); end

#no_autobump_message(*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)


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

def no_autobump_message(*args, &block); end

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

An old name for the cask.

Returns:



109
110
111
112
113
114
115
116
# File 'cask/cask.rb', line 109

def old_tokens
  @old_tokens ||= if (tap = self.tap)
    Tap.tap_migration_oldnames(tap, token) +
      tap.cask_reverse_renames.fetch(token, [])
  else
    []
  end
end

#on_system_block_min_os(*args, &block) ⇒ 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.

Parameters:

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

Returns:



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

def on_system_block_min_os(*args, &block); end

#on_system_blocks_exist?(*args, &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.

Parameters:

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

Returns:

  • (Boolean)


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

def on_system_blocks_exist?(*args, &block); end

#os(*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)


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

def os(*args, &block); end

#outdated?(greedy: false, greedy_latest: false, greedy_auto_updates: false) ⇒ Boolean

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Check if the installed cask is outdated.

Returns:

  • (Boolean)


329
330
331
332
# File 'cask/cask.rb', line 329

def outdated?(greedy: false, greedy_latest: false, greedy_auto_updates: false)
  !outdated_version(greedy:, greedy_latest:,
                    greedy_auto_updates:).nil?
end

#outdated_download_sha?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)


314
315
316
317
318
319
# File 'cask/cask.rb', line 314

def outdated_download_sha?
  return true unless checksumable?

  current_download_sha = download_sha_path.read if download_sha_path.exist?
  current_download_sha.blank? || current_download_sha != new_download_sha
end

#outdated_info(greedy, verbose, json, greedy_latest, greedy_auto_updates) ⇒ 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.



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'cask/cask.rb', line 352

def outdated_info(greedy, verbose, json, greedy_latest, greedy_auto_updates)
  return token if !verbose && !json

  installed_version = outdated_version(greedy:, greedy_latest:,
                                       greedy_auto_updates:).to_s

  if json
    {
      name:               token,
      installed_versions: [installed_version],
      current_version:    version,
    }
  else
    "#{token} (#{installed_version}) != #{version}"
  end
end

#outdated_version(greedy: false, greedy_latest: false, greedy_auto_updates: false) ⇒ 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.



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'cask/cask.rb', line 334

def outdated_version(greedy: false, greedy_latest: false, greedy_auto_updates: false)
  # special case: tap version is not available
  return if version.nil?

  if version.latest?
    return installed_version if (greedy || greedy_latest) && outdated_download_sha?

    return
  elsif auto_updates && !greedy && !greedy_auto_updates
    return
  end

  # not outdated unless there is a different version on tap
  return if installed_version == version

  installed_version
end

#pkg(*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)


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

def pkg(*args, &block); end

#populate_from_api!(cask_struct, tap_git_head:) ⇒ 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:

Raises:

  • (ArgumentError)


396
397
398
399
400
401
402
403
# File 'cask/cask.rb', line 396

def populate_from_api!(cask_struct, tap_git_head:)
  raise ArgumentError, "Expected cask to be loaded from the API" unless loaded_from_api?

  @languages = cask_struct.languages
  @tap_git_head = tap_git_head
  @ruby_source_path = cask_struct.ruby_source_path
  @ruby_source_checksum = cask_struct.ruby_source_checksum
end

#postflight(*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)


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

def postflight(*args, &block); end

#preflight(*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)


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

def preflight(*args, &block); end

#prefpane(*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)


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

def prefpane(*args, &block); end

#qlplugin(*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)


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

def qlplugin(*args, &block); end

#refreshObject

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.



124
125
126
127
128
129
130
131
132
133
# File 'cask/cask.rb', line 124

def refresh
  @dsl = DSL.new(self)
  return unless @block

  @dsl.instance_eval(&@block)
  @dsl.add_implicit_macos_dependency
  @dsl.language_eval
rescue NoMethodError => e
  raise CaskInvalidError.new(token, e.message), e.backtrace
end

#rename(*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)


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

def rename(*args, &block); end

#rename_list(uninstall_only: false) ⇒ 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.



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

def rename_list(uninstall_only: false)
  rename.filter_map do |rename|
    { from: rename.from, to: rename.to }
  end
end

#ruby_source_checksumHash{Symbol => 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:



379
380
381
382
383
# File 'cask/cask.rb', line 379

def ruby_source_checksum
  @ruby_source_checksum ||= {
    sha256: Digest::SHA256.file(sourcefile_path).hexdigest,
  }.freeze
end

#ruby_source_pathObject

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.



369
370
371
372
373
374
375
376
# File 'cask/cask.rb', line 369

def ruby_source_path
  return @ruby_source_path if defined?(@ruby_source_path)

  return unless sourcefile_path
  return unless tap

  @ruby_source_path = sourcefile_path.relative_path_from(tap.path)
end

#screen_saver(*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)


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

def screen_saver(*args, &block); end

#service(*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)


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

def service(*args, &block); end

#sha256(*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)


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

def sha256(*args, &block); end

#stage_only(*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)


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

def stage_only(*args, &block); 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)


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

def staged_path(*args, &block); end

#suite(*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)


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

def suite(*args, &block); end

#supports_linux?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)


179
180
181
182
183
184
185
186
187
188
189
# File 'cask/cask.rb', line 179

def supports_linux?
  return true if font?

  # Cache the os value before contains_os_specific_artifacts? refreshes the cask
  # (the refresh clears @dsl.os in generic/non-OS-specific contexts)
  os_value = @dsl.os

  return false if contains_os_specific_artifacts?

  os_value.present?
end

#supports_macos?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)


176
# File 'cask/cask.rb', line 176

def supports_macos? = true

#tabObject

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.



287
288
289
# File 'cask/cask.rb', line 287

def tab
  Tab.for_cask(self)
end

#tapObject

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.



52
53
54
55
56
# File 'cask/cask.rb', line 52

def tap
  return super if block_given? # Object#tap

  @tap
end

#tap_git_headObject

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.



389
390
391
392
393
# File 'cask/cask.rb', line 389

def tap_git_head
  @tap_git_head ||= tap&.git_head
rescue TapUnavailableError
  nil
end

#timestamped_versions(caskroom_path: self.caskroom_path) ⇒ Array<Array<(String, 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.

Parameters:

  • caskroom_path (Pathname) (defaults to: self.caskroom_path)

Returns:



141
142
143
144
145
146
147
148
# File 'cask/cask.rb', line 141

def timestamped_versions(caskroom_path: self.caskroom_path)
  pattern = (version: "*", timestamp: "*", caskroom_path:).to_s
  relative_paths = Pathname.glob(pattern)
                           .map { |p| p.relative_path_from(p.parent.parent) }
  # Sorbet is unaware that Pathname is sortable: https://github.com/sorbet/sorbet/issues/6844
  T.unsafe(relative_paths).sort_by(&:basename) # sort by timestamp
   .map { |p| p.split.map(&:to_s) }
end

#to_hObject

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.



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'cask/cask.rb', line 423

def to_h
  {
    "token"                           => token,
    "full_token"                      => full_name,
    "old_tokens"                      => old_tokens,
    "tap"                             => tap&.name,
    "name"                            => name,
    "desc"                            => desc,
    "homepage"                        => homepage,
    "url"                             => url,
    "url_specs"                       => url_specs,
    "version"                         => version,
    "autobump"                        => autobump?,
    "no_autobump_message"             => no_autobump_message,
    "skip_livecheck"                  => livecheck.skip?,
    "installed"                       => installed_version,
    "installed_time"                  => install_time&.to_i,
    "bundle_version"                  => bundle_long_version,
    "bundle_short_version"            => bundle_short_version,
    "outdated"                        => outdated?,
    "sha256"                          => sha256,
    "artifacts"                       => artifacts_list,
    "caveats"                         => caveats_for_api,
    "caveats_rosetta"                 => caveats_object.invoked?(:requires_rosetta) || nil,
    "depends_on"                      => depends_on,
    "conflicts_with"                  => conflicts_with,
    "container"                       => container&.pairs,
    "rename"                          => rename_list,
    "auto_updates"                    => auto_updates,
    "deprecated"                      => deprecated?,
    "deprecation_date"                => deprecation_date,
    "deprecation_reason"              => deprecation_reason,
    "deprecation_replacement_formula" => deprecation_replacement_formula,
    "deprecation_replacement_cask"    => deprecation_replacement_cask,
    "deprecate_args"                  => deprecate_args,
    "disabled"                        => disabled?,
    "disable_date"                    => disable_date,
    "disable_reason"                  => disable_reason,
    "disable_replacement_formula"     => disable_replacement_formula,
    "disable_replacement_cask"        => disable_replacement_cask,
    "disable_args"                    => disable_args,
    "tap_git_head"                    => tap_git_head,
    "languages"                       => languages,
    "ruby_source_path"                => ruby_source_path,
    "ruby_source_checksum"            => ruby_source_checksum,
  }
end

#to_hash_with_variationsObject

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.



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'cask/cask.rb', line 474

def to_hash_with_variations
  if loaded_from_internal_api?
    raise UsageError, "Cannot call #to_hash_with_variations on casks loaded from the internal API"
  end

  if loaded_from_api? && (json_cask = api_source) && !Homebrew::EnvConfig.no_install_from_api?
    return api_to_local_hash(json_cask.dup)
  end

  hash = to_h
  variations = {}

  if @dsl.on_system_blocks_exist?
    begin
      OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag|
        next if bottle_tag.linux? && @dsl.os.nil?
        next if bottle_tag.macos? &&
                depends_on.macos &&
                !@dsl.depends_on_set_in_block? &&
                !depends_on.macos.allows?(bottle_tag.to_macos_version)

        Homebrew::SimulateSystem.with_tag(bottle_tag) do
          refresh

          to_h.each do |key, value|
            next if HASH_KEYS_TO_SKIP.include? key
            next if value.to_s == hash[key].to_s

            variations[bottle_tag.to_sym] ||= {}
            variations[bottle_tag.to_sym][key] = value
          end
        end
      end
    ensure
      refresh
    end
  end

  hash["variations"] = variations
  hash
end

#uninstall(*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)


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

def uninstall(*args, &block); end

#uninstall_flight_blocks?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)


225
226
227
228
229
230
231
232
233
234
# File 'cask/cask.rb', line 225

def uninstall_flight_blocks?
  artifacts.any? do |artifact|
    case artifact
    when Artifact::PreflightBlock
      artifact.directives.key?(:uninstall_preflight)
    when Artifact::PostflightBlock
      artifact.directives.key?(:uninstall_postflight)
    end
  end
end

#uninstall_postflight(*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)


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

def uninstall_postflight(*args, &block); end

#uninstall_preflight(*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)


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

def uninstall_preflight(*args, &block); end

#url(*args, &block) ⇒ ::Cask::URL?

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:



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

def url(*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)


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

def version(*args, &block); end

#vst3_plugin(*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)


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

def vst3_plugin(*args, &block); end

#vst_plugin(*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)


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

def vst_plugin(*args, &block); end

#zap(*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)


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

def zap(*args, &block); end

#zsh_completion(*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)


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

def zsh_completion(*args, &block); end