From 2ad7f5317cb373e76fe3bb2c0a13b48a665b014a Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 29 Nov 2020 22:36:54 +0100 Subject: [PATCH] Add signatures for `Fetch` module. --- Library/Homebrew/fetch.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index 6297b5d628..f7bb7517e0 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -4,11 +4,16 @@ module Homebrew # @api private module Fetch + extend T::Sig + + sig { params(f: Formula, args: CLI::Args).returns(T::Boolean) } def fetch_bottle?(f, args:) - return true if args.force_bottle? && f.bottle - return false unless f.bottle && f.pour_bottle? + bottle = f.bottle + + return true if args.force_bottle? && bottle + return false unless bottle && f.pour_bottle? return false if args.build_from_source_formulae.include?(f.full_name) - return false unless f.bottle.compatible_cellar? + return false unless bottle.compatible_cellar? true end