Sam Ford 98f3258ff4
Livecheck: Add Crate strategy
We discussed the idea of adding a livecheck strategy to check crate
versions years ago but decided to put it off because it would have
only applied to one formula at the time (and it wasn't clear that a
crate was necessary in that case). We now have a few formulae that
use a crate in the `stable` URL (`cargo-llvm-cov`, `pngquant`,
`oakc`) and another formula with a crate resource (`deno`), so
there's some value to the idea now.

I established a standard approach for checking crate versions in a
somewhat recent `pngquant` `livecheck` block update and this commit
reworks it into a strategy, so we won't have to duplicate that
`livecheck` block in these cases. With this strategy, we usually
won't even need a `livecheck` block at all.

Under normal circumstances, a regex and/or strategy block shouldn't
be necessary but the strategy supports them when needed. The response
from the crates.io API is a JSON object, so this uses
`Json#versions_from_content` internally and a `strategy` block will
receive the parsed `json` object and a regex (the strategy default or
the regex from the `livecheck` block).
2024-02-11 21:53:21 -05:00
..
2023-04-21 09:58:50 -07:00
2023-05-19 10:55:28 -04:00
2023-04-21 09:58:50 -07:00
2024-02-11 21:53:21 -05:00
2023-08-10 16:08:47 +01:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00
2023-04-21 09:58:50 -07:00