Krikri::PluginHelpers::Homebrew
Homebrew - pure logic for the homebrew plugin: package-name
validation, brew info --json=v2 parsing (installed/outdated sets
with the real module's name-matching rules), and brew command
construction. Split out of plugins/homebrew.cr so this logic is
unit-spec-able (execution needs a real macOS/Linuxbrew host, which
no spec environment has).
Class methods
install_command(brew_path : String, packages : Array(String), install_options : Array(String), head : Bool, force_formula : Bool) : String
Sourcelink_command(brew_path : String, packages : Array(String), install_options : Array(String), unlink : Bool) : String
Sourceparse_info(json_output : String, packages : Array(String)) : Hash(String, NamedTuple(installed: Bool, outdated: Bool)) | Nil
brew info --json=v2 output -> per-requested-name {installed,
outdated} map, mirroring the real module's _get_packages_info:
a formula is installed when its installed array is non-empty,
outdated when its outdated flag is set. The user-supplied name
is matched against name/full_name/aliases/oldnames (plus the
tap-prefixed spellings) like the real _extract_package_name.
uninstall_command(brew_path : String, packages : Array(String), install_options : Array(String)) : String
Source