Sam Ford 03823b5698
Strategy#from_url: Amend conditions for Json
When the `Json` strategy was introduced, I forgot to also ensure
that it's only treated as usable (in `Strategy#from_url`) if a
`livecheck` block uses `strategy :json`. As a result, `Json` is
incorrectly treated as a usable strategy for all formulae/casks that
contain a `strategy` block.

Since all of these `livecheck` blocks specify a strategy, this bug
doesn't meaningfully impact livecheck's behavior (i.e., these checks
continue to use their explicitly-specified strategy). The only
practical difference is that `Json` incorrectly appears in the list
of usable strategies in livecheck's verbose JSON output.

This commit modifies `Strategy#from_url` to address this issue. The
easiest way to enforce this rule involved passing in the
`@strategies` key (a symbol) into the `select` block, so we can
compare it to `livecheck_strategy` (the strategy symbol specified in
the `livecheck` block).
2023-02-27 18:58:13 -05:00
..
2023-02-22 22:50:24 +00:00
2023-02-19 00:13:29 +00:00
2023-02-27 11:22:10 -08:00
2023-02-27 11:22:23 -08:00
2023-02-24 19:00:52 +00:00
2023-02-23 12:48:18 +00:00
2023-02-10 23:17:16 -05:00
2023-02-22 22:52:06 +00:00
2023-02-10 23:17:16 -05:00
2023-02-24 18:07:19 +00:00
2023-02-10 23:17:16 -05:00
2023-02-22 22:52:06 +00:00
2023-02-15 14:24:58 +00:00
2023-02-15 14:24:58 +00:00
2023-02-27 11:22:10 -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!