From 2120d285be54de9ef3b6c0f5e285603519746041 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Thu, 20 May 2021 11:29:33 -0400 Subject: [PATCH] formuala: update `pour_bottle?` docs --- Library/Homebrew/formula.rb | 2 +- docs/Bottles.md | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index b3b4cad15f..625b304ca1 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2920,7 +2920,7 @@ class Formula # the {Formula} will be built from source and `reason` will be printed. # # Alternatively, a preset reason can be passed as a symbol: - #
pour_bottle? only_if: :clt
+ #
pour_bottle? only_if: :clt_installed
def pour_bottle?(only_if: nil, &block) @pour_bottle_check = PourBottleCheck.new(self) diff --git a/docs/Bottles.md b/docs/Bottles.md index 3e7f57c7cf..de80e664a3 100644 --- a/docs/Bottles.md +++ b/docs/Bottles.md @@ -68,7 +68,13 @@ A full example: ```ruby pour_bottle? do - reason "The bottle needs the Xcode CLT to be installed." - satisfy { MacOS::CLT.installed? } + reason "The bottle needs to be installed into #{Homebrew::DEFAULT_PREFIX}." + satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX } 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 +```