formuala: update pour_bottle? docs

This commit is contained in:
Rylan Polster 2021-05-20 11:29:33 -04:00
parent 745d7ff813
commit 2120d285be
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
2 changed files with 9 additions and 3 deletions

View File

@ -2920,7 +2920,7 @@ class Formula
# the {Formula} will be built from source and `reason` will be printed. # the {Formula} will be built from source and `reason` will be printed.
# #
# Alternatively, a preset reason can be passed as a symbol: # Alternatively, a preset reason can be passed as a symbol:
# <pre>pour_bottle? only_if: :clt</pre> # <pre>pour_bottle? only_if: :clt_installed</pre>
def pour_bottle?(only_if: nil, &block) def pour_bottle?(only_if: nil, &block)
@pour_bottle_check = PourBottleCheck.new(self) @pour_bottle_check = PourBottleCheck.new(self)

View File

@ -68,7 +68,13 @@ A full example:
```ruby ```ruby
pour_bottle? do pour_bottle? do
reason "The bottle needs the Xcode CLT to be installed." reason "The bottle needs to be installed into #{Homebrew::DEFAULT_PREFIX}."
satisfy { MacOS::CLT.installed? } satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX }
end end
``` ```
Commonly used `pour_bottle?` conditions can be added as preset symbols to the `pour_bottle?` method, allowing them to be specified like this:
```ruby
pour_bottle? only_if: :clt_installed
```