36 Commits

Author SHA1 Message Date
Anton Melnikov
75146e032c
docs: suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-06-25 15:30:06 +02:00
botantony
0dc48348af
docs: add autobump-related documentation
Signed-off-by: botantony <antonsm21@gmail.com>
2025-06-23 15:06:37 +02:00
Eric Knibbe
493f2aa9f0
docs/Brew-Livecheck review 2025-05-28 13:53:38 -04:00
Michael Stingl
e2992d4c3a
Apply suggestions from code review
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2025-04-15 16:42:52 +02:00
michaelstingl
66d36fb4f6 docs: Add section on handling temporary pre-release versions in livecheck 2025-04-15 07:28:55 +02:00
Sam Ford
5e57df7287
livecheck: restrict POST hashes to symbol keys
I initially set the type for livecheck's `post_form` and `post_json`
hashes to allow either a string or symbol key. I used string keys in
the documentation, as there will inevitably be some form field names
that would pose a problem for symbols (e.g., `E-mail` uses a hyphen,
`1twothree` starts with a digit, etc.). However, I remembered that we
can simply use quote symbols like `:"E-mail"` to handle these
situations, as they have the flexibility of a string while still being
a symbol.

With that in mind, this updates related type signatures to only allow
symbol keys and updates documentation and tests accordingly. The
documentation example contains a hyphenated form field, so it
demonstrates how to handle names that don't work as a bare symbol.
2025-02-21 21:54:46 -05:00
Sam Ford
b4757af656
livecheck: Add support for POST requests
livecheck currently doesn't support `POST` requests but it wasn't
entirely clear how best to handle that. I initially approached it as
a `Post` strategy but unfortunately that would have required us to
handle response body parsing (e.g., JSON, XML, etc.) in some fashion.
We could borrow some of the logic from related strategies but we would
still be stuck having to update `Post` whenever we add a strategy for
a new format.

Instead, this implements `POST` support by borrowing ideas from the
`using: :post` and `data` `url` options found in formulae. This uses
a `post_form` option to handle form data and `post_json` to handle
JSON data, encoding the hash argument for each into the appropriate
format. The presence of either option means that curl will use a
`POST` request.

With this approach, we can make a `POST` request using any strategy
that calls `Strategy::page_headers` or `::page_content` (directly or
indirectly) and everything else works the same as usual. The only
change needed in related strategies was to pass the options through
to the `Strategy` methods.

For example, if we need to parse a JSON response from a `POST`
request, we add a `post_data` or `post_json` hash to the `livecheck`
block `url` and use `strategy :json` with a `strategy` block. This
leans on existing patterns that we're already familiar with and
shouldn't require any notable maintenance burden when adding new
strategies, so it seems like a better approach than a `Post` strategy.
2025-02-07 08:53:47 -05:00
Issy Long
31d7bcc583
Add a last_reviewed_date to docs metadata
- At the AGM we formed an ad-hoc documentation working group.
- One of our ideas was that we should have a last reviewed date for
  documentation, so that we can periodically implement a review
  mechanism (GitHub Actions posts to Slack for a regular documentation
  outdatedness check?) to track how old docs are and ensure they're
  still relevant.
- This is a first step towards that goal, by adding a `last_review_date`
  to the metadata of all docs with a date of earlier than Homebrew's
  inception because everything needs reviewing so that we start from a
  good base!
2025-02-03 11:56:07 +00:00
James Kerrane
e3082ac5d8 docs: Update find-appcast command
Updates the documentation for PR https://github.com/Homebrew/homebrew-cask/pull/174292 that converted find-appcast from a developer script to command.
2024-08-02 14:48:03 -06:00
Muescha
5ce0124c4b
Update docs/Brew-Livecheck.md - simplify regex
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2024-07-18 18:00:59 +02:00
Muescha
3b0488edb4
Update docs/Brew-Livecheck.md - better wording
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2024-07-18 17:58:13 +02:00
Muescha
f0f491b417
Update docs/Brew-Livecheck.md - uppercase YAML and quotation
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2024-07-18 17:57:50 +02:00
Muescha
cee029516e
Update Brew-Livecheck.md
fix ruby style guide check
2024-07-18 16:07:26 +02:00
Muescha
8a00f0451b
Update Brew-Livecheck.md: add examples for modify version information
add examples for modify version information
2024-07-18 15:56:43 +02:00
Mike McQuaid
ed0d6b7f61
docs: fix brew style 2024-06-12 19:17:17 +01:00
Sam Ford
55ec4c483c
Crate: Rework conditions
Co-authored-by: Douglas Eichelberger <dduugg@gmail.com>
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-02-11 21:53:21 -05:00
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
Rylan Polster
2a1a54c58a
Add deprecate! and disable! to cask docs 2023-12-17 19:59:53 -05:00
Eric Knibbe
484efe2911
docs: various additions & changes 2023-09-05 01:06:31 -04:00
Eric Knibbe
4205cb495a
docs: rework Cask-Cookbook to match current practice
and migrate `livecheck` stanza documentation to Brew-Livecheck.md
2023-09-02 00:43:51 -04:00
Sam Ford
e9e484ea31
docs: Fix GithubReleases strategy block example
The `strategy` block example for `GithubReleases` in the
`brew livecheck` documentation should be using `release` inside the
`#map` block instead of `json`. I accidentally overlooked one instance
of `json` when adapting the code from the `GithubLatest` example above
it.
2023-07-28 10:23:35 -04:00
Patrick Linnane
c56669e9cd
various: fix miscellaneous typos 2023-07-18 08:52:49 -07:00
Sam Ford
9b6e8f8dc5
Update brew livecheck documentation 2023-05-16 16:08:20 -04:00
Sam Ford
33268e4fb0
livecheck: Add Yaml strategy
This adds a generic `Yaml` strategy to livecheck that requires a
`strategy` block to operate. The YAML-parsing code is taken from the
existing approach in the `ElectronBuilder` strategy.

We don't currently have any `strategy` blocks in first-party taps
that manually parse YAML. However, creating a generic `Yaml` strategy
allows us to simplify `ElectronBuilder` (and any future strategy
that works with YAML) while making it easy to create custom `Yaml`
`strategy` blocks in formulae/casks as needed.
2023-03-02 16:20:39 -05:00
Sam Ford
7d9e1a50e8
livecheck: Add Xml strategy
This adds a generic `Xml` strategy to livecheck that requires a
`strategy` block to operate. The XML-parsing code is taken from the
existing approach in the `Sparkle` strategy. As such, `Sparkle` has
been updated to use the `Xml#parse_xml` method instead.

Unlike the `Json` strategy, we don't currently have any `strategy`
blocks in first-party taps that manually parse XML. However, we had a
user request support for something like this and I was already working
on an `Xml` strategy (as a way of extracting the XML-parsing code
from `Sparkle` into something general-purpose), so here we are.

Future strategies that parse simple XML data can potentially use the
`Xml#find_versions` method (similar to how we have strategies that
leverage `PageMatch#find_versions`) instead of having to implement
something bespoke like `Sparkle`.
2023-02-28 14:58:11 -05:00
Sam Ford
7735036c56
livecheck: Add Json strategy
This adds a generic `Json` strategy to livecheck that requires a
`strategy` block to operate. This is primarily intended as a
replacement for existing `strategy` blocks in formulae/casks that
use `JSON#parse`, as it allows us to internalize/standardize that
boilerplate while improving error-handling.

Additionally, future strategies that parse JSON data can use the
`Json#find_versions` method instead of having to reinvent the wheel
(similar to how we currently have a number of strategies that
leverage `PageMatch#find_versions`).
2023-02-23 13:17:35 -05:00
EricFromCanada
d615899ca9
Contributors docs: content & formatting updates
Update How-To-Open-a-Homebrew-Pull-Request.md

Update Acceptable-Formulae.md

Update Acceptable-Casks.md

Update License-Guidelines.md

Update Versions.md

Update Versions.md

Update Deprecating-Disabling-and-Removing-Formulae.md

Update Node-for-Formula-Authors.md

Update Python-for-Formula-Authors.md

Update Brew-Livecheck.md

Update Migrating-A-Formula-To-A-Tap.md

Update Rename-A-Formula.md

Update How-to-Create-and-Maintain-a-Tap.md

Update Brew-Test-Bot.md

Update Typechecking.md
2022-11-16 09:03:12 -05:00
Mohammad Zain Abbas
bd4a4e3254
Update docs/Brew-Livecheck.md
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2022-10-02 23:05:02 -04:00
Mohammad Zain Abbas
d66104f182
Update docs/Brew-Livecheck.md
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2022-10-02 23:05:02 -04:00
Mohammad Zain Abbas
50ccb96d77
Reverted back changes 2022-10-02 23:05:02 -04:00
Mohammad Zain Abbas
de2972d8b5
Reverted numbering from numbered lists to generic 1s 2022-10-02 23:05:02 -04:00
Mohammad Zain Abbas
07ac5bf3b6
Update doc for brew livecheck 2022-10-02 23:05:02 -04:00
Sam Ford
0bc3d6cf4b
docs: add livecheck formula/cask reference example 2021-08-02 09:12:23 -04:00
Markus Reiter
fb29dec0de Improve livecheck docs. 2021-01-14 18:44:35 +01:00
Sam Ford
308390ba5b
Address feedback and expand documentation
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com>
2021-01-11 17:51:41 -05:00
Sam Ford
94f900ea87
docs: add brew livecheck documentation 2021-01-11 15:58:49 -05:00