Homebrew / homebrew-portable-ruby

🚗 Versions of Ruby that can be installed and run from anywhere on the filesystem.
BSD 2-Clause "Simplified" License
128 stars 43 forks source link

Update formula livecheck blocks #206

Closed samford closed 2 months ago

samford commented 2 months ago

As requested in https://github.com/Homebrew/homebrew-portable-ruby/issues/203#issuecomment-2135115748, this integrates changes from @Bo98's livecheck blocks. This also updates the portable-ruby livecheck block to avoid X.Y.0 versions.

I mentioned in https://github.com/Homebrew/homebrew-portable-ruby/issues/203#issuecomment-2135154188 that I was checking the Ruby Releases page (instead of the main Downloads page) because we needed all of the versions for a given major/minor to be able to identify the latest non-X.Y.0 version. However, thinking about this some more, we will want the latest version from the previous major/minor when there's a new X.Y.0 version and the download page provides that information. With that in mind, we can use formula "ruby" with a regex override for the version restriction.

[For what it's worth, I generally try to avoid regex lookarounds for the sake of performance but I've handled the portable-ruby version restriction using a regex as it's technically faster than a strategy block approach. The tradeoff is that it's harder to read the regex compared to strategy block code but it's not too bad.]

MikeMcQuaid commented 2 months ago

Thanks again @samford!