Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livecheck: Add Crate strategy #16620

Merged
merged 2 commits into from
Feb 12, 2024

Commits on Feb 12, 2024

  1. 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).
    samford committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    98f3258 View commit details
    Browse the repository at this point in the history
  2. Crate: Rework conditions

    Co-authored-by: Douglas Eichelberger <dduugg@gmail.com>
    Co-authored-by: Markus Reiter <me@reitermark.us>
    3 people committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    55ec4c4 View commit details
    Browse the repository at this point in the history