Class: Homebrew::Cmd::Cache Private

Inherits:
AbstractCommand show all
Includes:
Fetch
Defined in:
sorbet/rbi/dsl/homebrew/cmd/cache.rbi,
cmd/--cache.rb

Overview

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

DO NOT EDIT MANUALLY This is an autogenerated file for dynamic methods in Homebrew::Cmd::Cache. Please instead update this file by running bin/tapioca dsl Homebrew::Cmd::Cache.

Defined Under Namespace

Classes: Args

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fetch

#fetch_bottle?

Methods inherited from AbstractCommand

command, dev_cmd?, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Class Method Details

.command_nameString

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

Returns:



14
# File 'cmd/--cache.rb', line 14

def self.command_name = "--cache"

Instance Method Details

#argsHomebrew::Cmd::Cache::Args

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.



9
# File 'sorbet/rbi/dsl/homebrew/cmd/cache.rbi', line 9

def args; end

#runvoid

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

This method returns an undefined value.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'cmd/--cache.rb', line 50

def run
  if args.no_named?
    puts HOMEBREW_CACHE
    return
  end

  formulae_or_casks = args.named.to_formulae_and_casks
  os_arch_combinations = args.os_arch_combinations

  formulae_or_casks.each do |formula_or_cask|
    case formula_or_cask
    when Formula
      formula = formula_or_cask
      ref = formula.loaded_from_api? ? formula.full_name : formula.path

      os_arch_combinations.each do |os, arch|
        SimulateSystem.with(os:, arch:) do
          formula = Formulary.factory(ref)
          print_formula_cache(formula, os:, arch:)
        end
      end
    when Cask::Cask
      cask = formula_or_cask
      ref = cask.loaded_from_api? ? cask.full_name : cask.sourcefile_path

      os_arch_combinations.each do |os, arch|
        next if os == :linux

        SimulateSystem.with(os:, arch:) do
          loaded_cask = Cask::CaskLoader.load(ref)
          print_cask_cache(loaded_cask)
        end
      end
    else
      raise "Invalid type: #{formula_or_cask.class}"
    end
  end
end