formuala: update pour_bottle?
docs
This commit is contained in:
parent
745d7ff813
commit
2120d285be
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user