Class: Homebrew::Bundle::Checker::UvChecker Private

Inherits:
Base
  • Object
show all
Defined in:
bundle/uv_checker.rb

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.

Constant Summary collapse

PACKAGE_TYPE =

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.

:uv
PACKAGE_TYPE_NAME =

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.

"uv Tool"

Instance Method Summary collapse

Methods inherited from Base

#checkable_entries, #exit_early_check, #find_actionable, #full_check

Instance Method Details

#failure_reason(package, no_upgrade:) ⇒ 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:

  • package (Hash{Symbol => T.untyped})
  • no_upgrade (Boolean)

Returns:



23
24
25
26
# File 'bundle/uv_checker.rb', line 23

def failure_reason(package, no_upgrade:)
  name = T.cast(package[:name], String)
  "#{PACKAGE_TYPE_NAME} #{name} needs to be installed."
end

#format_checkable(entries) ⇒ Array<Hash{Symbol => 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:

Returns:



16
17
18
19
20
# File 'bundle/uv_checker.rb', line 16

def format_checkable(entries)
  checkable_entries(entries).map do |entry|
    { name: entry.name, options: entry.options || {} }
  end
end

#installed_and_up_to_date?(package, no_upgrade: 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:

  • package (Hash{Symbol => T.untyped})
  • no_upgrade (Boolean) (defaults to: false)

Returns:

  • (Boolean)


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

def installed_and_up_to_date?(package, no_upgrade: false)
  require "bundle/uv_installer"

  options = T.cast(package[:options], T::Hash[Symbol, T.untyped])
  Homebrew::Bundle::UvInstaller.package_installed?(
    T.cast(package[:name], String),
    with: T.cast(options[:with] || [], T::Array[String]),
  )
end