Skip to content

Commit c76f378

Browse files
authored
Merge pull request #20884 from Homebrew/rubydoc_links
Change RubyDoc links and fix workflow
2 parents 08943c4 + c8db78a commit c76f378

16 files changed

+93
-89
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,21 @@ jobs:
8484
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8585

8686
- name: Rebuild the site with YARD
87+
if: github.repository == 'Homebrew/brew'
8788
working-directory: docs
8889
run: bundle exec rake yard build
8990
env:
9091
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9192

9293
- name: Upload pages artifact
94+
if: github.repository == 'Homebrew/brew'
9395
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
9496
with:
9597
path: docs/_site/
9698

9799
deploy:
98100
needs: docs
99-
if: ${{ github.ref_name == 'main' }}
101+
if: ${{ github.repository == 'Homebrew/brew' && github.ref_name == 'main' }}
100102
permissions:
101103
pages: write
102104
id-token: write
@@ -115,7 +117,7 @@ jobs:
115117
deploy-issue:
116118
name: Open/close deploy issue
117119
needs: [docs, deploy]
118-
if: ${{ always() && github.ref_name == 'main' }}
120+
if: ${{ github.repository == 'Homebrew/brew' && always() && github.ref_name == 'main' }}
119121
env:
120122
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
121123
runs-on: ubuntu-latest

Library/Homebrew/dev-cmd/create.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Create < AbstractCommand
1616
and open it in the editor. Homebrew will attempt to automatically derive the
1717
formula name and version, but if it fails, you'll have to make your own template.
1818
The `wget` formula serves as a simple example. For the complete API, see:
19-
<https://rubydoc.brew.sh/Formula>
19+
<https://docs.brew.sh/rubydoc/Formula>
2020
EOS
2121
switch "--autotools",
2222
description: "Create a basic template for an Autotools-style build."

Library/Homebrew/formula_creator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def latest_versioned_formula(name)
162162
def template
163163
<<~ERB
164164
# Documentation: https://docs.brew.sh/Formula-Cookbook
165-
# https://rubydoc.brew.sh/Formula
165+
# https://docs.brew.sh/rubydoc/Formula
166166
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
167167
class #{Formulary.class_s(name)} < Formula
168168
<% if @mode == :python %>
@@ -229,7 +229,7 @@ def install
229229
system "cmake", "--install", "build"
230230
<% elsif @mode == :autotools %>
231231
# Remove unrecognized options if they cause configure to fail
232-
# https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method
232+
# https://docs.brew.sh/rubydoc/Formula.html#std_configure_args-instance_method
233233
system "./configure", "--disable-silent-rules", *std_configure_args
234234
system "make", "install" # if this fails, try separate make/make install steps
235235
<% elsif @mode == :crystal %>
@@ -283,7 +283,7 @@ def install
283283
system "zig", "build", *std_zig_args
284284
<% else %>
285285
# Remove unrecognized options if they cause configure to fail
286-
# https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method
286+
# https://docs.brew.sh/rubydoc/Formula.html#std_configure_args-instance_method
287287
system "./configure", "--disable-silent-rules", *std_configure_args
288288
# system "cmake", "-S", ".", "-B", "build", *std_cmake_args
289289
<% end %>

Library/Homebrew/manpages/brew.1.md.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ And for an authenticated HTTP proxy:
200200

201201
Homebrew Documentation: <https://docs.brew.sh>
202202

203-
Homebrew API: <https://rubydoc.brew.sh>
203+
Homebrew API: <https://docs.brew.sh/rubydoc/>
204204

205205
`git`(1), `git-log`(1)
206206

docs/Autobump.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Other formula and cask specific reasons for why a package is not autobumped are
2020

2121
When using `no_autobump!`, a reason for exclusion must be provided.
2222

23-
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol, which can be found in [`NO_AUTOBUMP_REASONS_LIST`](https://rubydoc.brew.sh/top-level-namespace#NO_AUTOBUMP_REASONS_LIST-constant), for example:
23+
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol, which can be found in [`NO_AUTOBUMP_REASONS_LIST`](/rubydoc/top-level-namespace.html#NO_AUTOBUMP_REASONS_LIST-constant), for example:
2424

2525
```ruby
2626
no_autobump! because: :bumped_by_upstream

docs/Brew-Livecheck.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ last_review_date: 2025-05-28
44

55
# `brew livecheck`
66

7-
The `brew livecheck` command finds the newest version of a formula or cask's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy) to identify versions from various sources, such as Git repositories, websites, etc.
7+
The `brew livecheck` command finds the newest version of a formula or cask's software by checking upstream. Livecheck has [strategies](/rubydoc/Homebrew/Livecheck/Strategy.html) to identify versions from various sources, such as Git repositories, websites, etc.
88

99
## Behaviour
1010

1111
When livecheck isn't given instructions for how to check for upstream versions, it does the following by default:
1212

1313
1. Collect a list of URLs to check.
14-
* For formulae: use their `stable`, `head`, and `homepage` URLs, in that order.
15-
* For formula resources: use their `url`.
16-
* For casks: use their `url` and `homepage` URLs, in that order.
14+
15+
* For formulae: use their `stable`, `head`, and `homepage` URLs, in that order.
16+
* For formula resources: use their `url`.
17+
* For casks: use their `url` and `homepage` URLs, in that order.
18+
1719
1. Determine if any strategies apply to the first URL. If not, try the next URL.
1820
1. If a strategy can be applied, use it to check for new versions.
1921
1. Return the newest version (or an error if versions could not be found at any available URLs).
2022

2123
It's sometimes necessary to override this default behaviour to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block.
2224

23-
This can be accomplished by adding a `livecheck` block to the formula/cask/resource. For more information on the available methods, please refer to the [`Livecheck` class](https://rubydoc.brew.sh/Livecheck) documentation.
25+
This can be accomplished by adding a `livecheck` block to the formula/cask/resource. For more information on the available methods, please refer to the [`Livecheck` class](/rubydoc/Livecheck.html) documentation.
2426

2527
## Creating a check
2628

docs/Cask-Cookbook.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Each of the following stanzas is required for every cask.
129129

130130
### At least one artifact stanza is also required
131131

132-
Each cask must declare one or more [artifacts](https://rubydoc.brew.sh/Cask/Artifact) (i.e. something to install).
132+
Each cask must declare one or more [artifacts](/rubydoc/Cask/Artifact.html) (i.e. something to install).
133133

134134
| name | multiple occurrences allowed? | value |
135135
| -------------------------------- | :---------------------------: | ----- |
@@ -291,7 +291,7 @@ caveats "Using #{token} may be hazardous to your health."
291291

292292
#### `caveats` as a block
293293

294-
When `caveats` is a Ruby block, evaluation is deferred until install time. Within a block you may refer to the `@cask` instance variable, and invoke [any method available on `@cask`](https://rubydoc.brew.sh/Cask/Cask).
294+
When `caveats` is a Ruby block, evaluation is deferred until install time. Within a block you may refer to the `@cask` instance variable, and invoke [any method available on `@cask`](/rubydoc/Cask/Cask.html).
295295

296296
#### `caveats` mini-DSL
297297

@@ -371,7 +371,7 @@ depends_on formula: "unar"
371371

372372
##### Requiring an exact macOS release
373373

374-
The value for `depends_on macos:` may be a symbol or an array of symbols, listing the exact compatible macOS releases. The values for supported macOS releases can be found in the [`MacOSVersion` class](https://rubydoc.brew.sh/MacOSVersion) documentation.
374+
The value for `depends_on macos:` may be a symbol or an array of symbols, listing the exact compatible macOS releases. The values for supported macOS releases can be found in the [`MacOSVersion` class](/rubydoc/MacOSVersion.html) documentation.
375375

376376
Only major releases are covered (10.x numbers containing a single dot or whole numbers since macOS 11). The symbol form is used for readability. The following are all valid ways to enumerate the exact macOS release requirements for a cask:
377377

@@ -449,7 +449,7 @@ The `because:` parameter can also accept a symbol that corresponds to a preset r
449449
deprecate! date: "YYYY-MM-DD", because: :discontinued
450450
```
451451

452-
A complete list of allowable symbols can be found in the [`DeprecateDisable` module](https://rubydoc.brew.sh/DeprecateDisable) documentation.
452+
A complete list of allowable symbols can be found in the [`DeprecateDisable` module](/rubydoc/DeprecateDisable.html) documentation.
453453

454454
#### `replacement_formula:` / `replacement_cask:` parameter
455455

@@ -527,7 +527,7 @@ The stanzas `preflight`, `postflight`, `uninstall_preflight`, and `uninstall_pos
527527

528528
#### Evaluation of blocks is always deferred
529529

530-
The Ruby blocks defined by these stanzas are not evaluated until install time or uninstall time. Within a block you may refer to the `@cask` instance variable, and invoke [any method available on `@cask`](https://rubydoc.brew.sh/Cask/Cask).
530+
The Ruby blocks defined by these stanzas are not evaluated until install time or uninstall time. Within a block you may refer to the `@cask` instance variable, and invoke [any method available on `@cask`](/rubydoc/Cask/Cask.html).
531531

532532
#### `*flight` mini-DSL
533533

@@ -655,7 +655,7 @@ The `no_autobump!` stanza excludes a cask from the autobump list. This means all
655655
no_autobump! because: :incompatible_version_format
656656
```
657657

658-
A complete list of allowed symbols can be found in [`NO_AUTOBUMP_REASONS_LIST`](https://rubydoc.brew.sh/top-level-namespace#NO_AUTOBUMP_REASONS_LIST-constant).
658+
A complete list of allowed symbols can be found in [`NO_AUTOBUMP_REASONS_LIST`](/rubydoc/top-level-namespace.html#NO_AUTOBUMP_REASONS_LIST-constant).
659659

660660
Casks that use `strategy :extract_plist` in their `livecheck` block or have `version :latest` are always excluded from the autobump list and do not require `no_autobump!` to be declared.
661661

docs/Deprecating-Disabling-and-Removing-Casks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ A cask should be removed if it does not meet our criteria for [acceptable casks]
9090

9191
When a cask is deprecated or disabled, a reason explaining the action must be provided.
9292

93-
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](https://rubydoc.brew.sh/DeprecateDisable.html):
93+
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](/rubydoc/DeprecateDisable.html.html):
9494

9595
- `:discontinued`: the cask is discontinued upstream
9696
- `:moved_to_mas`: the cask is now exclusively distributed on the Mac App Store

docs/Deprecating-Disabling-and-Removing-Formulae.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ A formula should be removed if it does not meet our criteria for [acceptable for
9090

9191
When a formula is deprecated or disabled, a reason explaining the action must be provided.
9292

93-
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](https://rubydoc.brew.sh/DeprecateDisable.html):
93+
There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](/rubydoc/DeprecateDisable.html.html):
9494

9595
- `:does_not_build`: the formula cannot be built from source on any supported macOS version or Linux.
9696
- `:no_license`: we cannot identify a license for the formula

docs/External-Commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ An executable script for a command named `extcmd` should be named `brew-extcmd`.
4040

4141
## Providing `--help`
4242

43-
All internal and external Homebrew commands can provide styled `--help` output by using Homebrew’s [argument parser](https://rubydoc.brew.sh/Homebrew/CLI/Parser), as seen in the [`brew test-bot` command](https://github.com/Homebrew/homebrew-test-bot/blob/HEAD/cmd/test-bot.rb); or by including lines starting with `#:` (a comment then `:` character in both Bash and Ruby), as seen in the [header of `update.sh`](https://github.com/Homebrew/brew/blob/cf7def0c68903814c6b4e04a55fe8f3cb3f5605e/Library/Homebrew/cmd/update.sh#L1-L10), which is printed with `brew update --help`.
43+
All internal and external Homebrew commands can provide styled `--help` output by using Homebrew’s [argument parser](/rubydoc/Homebrew/CLI/Parser.html), as seen in the [`brew test-bot` command](https://github.com/Homebrew/homebrew-test-bot/blob/HEAD/cmd/test-bot.rb); or by including lines starting with `#:` (a comment then `:` character in both Bash and Ruby), as seen in the [header of `update.sh`](https://github.com/Homebrew/brew/blob/cf7def0c68903814c6b4e04a55fe8f3cb3f5605e/Library/Homebrew/cmd/update.sh#L1-L10), which is printed with `brew update --help`.
4444

4545
## Unofficial external commands
4646

0 commit comments

Comments
 (0)