Sam Ford 38410f5432
bump-cask-pr: fix macOS host handling
`bump-cask-pr` was recently updated to add Linux support but the
change to the `replace_version_and_checksum` logic has broken the
command for casks that have on_system blocks that reference specific
macOS versions (e.g., `on_monterey :or_newer` in `logi-options+`).

The previous logic only simulated the arch, so the `current_os` value
on macOS was a specific version like `:sequoia`. The current logic
uses generic `:macos` values, which work for `on_macos` blocks but
don't work for blocks like `on_sequoia`, etc. This leads to an
`undefined method 'latest?' for nil` error, as `old_cask.version` is
`nil` in this scenario (i.e., none of the on_system blocks apply to
`:macos`, so `version` is never set).

This updates the method to only specify the OS in `system_options` if
the value doesn't align with the host (e.g., `:linux` on macOS),
which restores the previous behavior.

This also replaces `:macos` values with the newest macOS version
(e.g., `:sequoia`), so that `bump-cask-pr` on Linux can update casks
with on_system blocks that reference specific macOS versions. A
generic `:macos` value doesn't work with those on_system blocks, so
`version` is never called on Linux in that scenario but it works as
expected if we use the newest macOS value instead. This may not be
perfect but it brings `bump-cask-pr` a little closer to parity with
macOS on Linux.

Lastly, this skips `system_options` values where `old_cask` has no
version, as this means the cask doesn't apply to that OS/arch. We've
been seeing a related error on homebrew/cask autobump CI and this
guard should help to avoid it.
2025-04-03 17:56:47 -04:00
..
2025-02-06 21:04:08 -08:00
2025-04-02 16:34:28 +11:00
2025-04-02 17:15:36 +01:00
2025-03-30 03:24:24 +02:00
2025-03-27 03:38:09 +00:00
2025-01-19 12:32:55 +01:00
2025-04-03 19:52:02 +00:00
2025-03-31 17:55:07 +01:00
2025-03-31 17:55:07 +01:00
2025-01-16 15:12:03 -08:00
2025-02-06 21:04:08 -08:00
2025-02-04 16:27:39 +00:00
2025-02-17 18:56:31 -08:00
2025-02-17 18:56:31 -08:00
2025-03-02 21:36:03 -08:00
2025-02-16 13:26:10 -08:00
2025-04-03 12:47:21 +01:00
2025-03-31 17:55:07 +01:00
2025-03-30 18:15:00 +02:00
2025-02-06 21:04:08 -08:00
2025-02-17 18:56:31 -08:00
2025-02-04 16:27:39 +00:00
2025-02-04 16:27:39 +00:00
2025-03-02 21:36:03 -08:00
2025-03-31 17:55:07 +01:00
2025-03-27 03:38:09 +00:00
2025-03-02 21:36:03 -08:00
2025-02-06 21:04:08 -08:00
2025-02-24 11:57:20 -08:00
2025-02-17 19:11:48 -08:00

Homebrew Ruby API

This is the API for Homebrew.

The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.

You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.

Good luck!