If you're trying to use `brew info --json=v2` to get an installed
version and figure out if it is outdated: you're going to have a bad
time with `auto_updates` casks because `installed_version` alone is not
enough to get the actually currently installed version of the app.
Instead, in these cases, try to read from `Info.plist` if there is one
and use that version.
While we're here, add a `blank?` method to `Version` so we can use it
for `present?` checks (making a `null?` `Version` object `blank?`).
Co-authored-by: Markus Reiter <me@reitermark.us>
The existing date version parsing regex only matches file names that
have a prefix (e.g., `ltopers-v2017-04-14.tar.gz`), so it doesn't
match files like `2023-09-28.tar.gz`. There are a handful of formulae
that have to manually specify the version as a result (e.g.,
`marksman`, `sqtop`, etc.). `bootloadhid` is also affected but that's
because the filename uses a dot as the prefix delimiter (e.g.,
`bootloadHID.2012-12-08.tar.gz`) and the regex only matches a hyphen.
This addresses these shortcomings by using `[._-]` as the prefix
delimiter and making it optional.
Co-authored-by: Markus Reiter <me@reitermark.us>
The existing date version parsing regex only matches file names that
have a prefix (e.g., `ltopers-v2017-04-14.tar.gz`), so it doesn't
match files like `2023-09-28.tar.gz`. There are a handful of formulae
that have to manually specify the version as a result (e.g.,
`marksman`, `sqtop`, etc.). `bootloadhid` is also affected but that's
because the filename uses a dot as the prefix delimiter (e.g.,
`bootloadHID.2012-12-08.tar.gz`) and the regex only matches a hyphen.
This addresses these shortcomings by using `[._-]` as the prefix
delimiter and making it optional.
We have no commands with Sorbet disabled and have had Sorbet enabled
for developers for a decent amount of time. As a result, we can enable
it for everyone who has run a developer command.
This also allows a bunch of `raise TypeError`s to be removed in favour
of relying on Sorbet here instead.