Module: Homebrew::Bundle::CaskDumper Private

Defined in:
bundle/cask_dumper.rb

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

Class Method Summary collapse

Class Method Details

.cask_is_outdated_using_greedy?(cask_name) ⇒ 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)


24
25
26
27
28
29
30
31
# File 'bundle/cask_dumper.rb', line 24

def self.cask_is_outdated_using_greedy?(cask_name)
  return false unless Bundle.cask_installed?

  cask = casks.find { |c| c.to_s == cask_name }
  return false if cask.nil?

  cask.outdated?(greedy: true)
end

.cask_namesObject

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.



13
14
15
# File 'bundle/cask_dumper.rb', line 13

def self.cask_names
  @cask_names ||= casks.map(&:to_s)
end

.dump(describe: 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.



33
34
35
36
37
38
39
# File 'bundle/cask_dumper.rb', line 33

def self.dump(describe: false)
  casks.map do |cask|
    description = "# #{cask.desc}\n" if describe && cask.desc.present?
    config = ", args: { #{explicit_s(cask.config)} }" if cask.config.present? && cask.config.explicit.present?
    "#{description}cask \"#{cask}\"#{config}"
  end.join("\n")
end

.formula_dependencies(cask_list) ⇒ 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.



41
42
43
44
45
46
47
48
49
50
# File 'bundle/cask_dumper.rb', line 41

def self.formula_dependencies(cask_list)
  return [] unless Bundle.cask_installed?
  return [] if cask_list.blank?

  casks.flat_map do |cask|
    next unless cask_list.include?(cask.to_s)

    cask.depends_on[:formula]
  end.compact
end

.outdated_cask_namesObject

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.



17
18
19
20
21
22
# File 'bundle/cask_dumper.rb', line 17

def self.outdated_cask_names
  return [] unless Bundle.cask_installed?

  casks.select { |c| c.outdated?(greedy: false) }
       .map(&:to_s)
end

.reset!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.



7
8
9
10
11
# File 'bundle/cask_dumper.rb', line 7

def self.reset!
  @casks = nil
  @cask_names = nil
  @cask_hash = nil
end