From 4063675e0ec5e9fc082ce3f23d254ff7add37a9c Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Thu, 23 Nov 2023 18:53:22 +0300 Subject: [PATCH] Suggestion by @MikeMcQuaid "ActiveSupport adds blank? to NilClass." --- Library/Homebrew/formula_creator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 043083bc65..cdbcf8bf27 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -50,7 +50,8 @@ module Homebrew end def write_formula! - raise "name should not be empty" if @name.to_s == "" + raise ArgumentError, "name is blank!" if @name.blank? + raise ArgumentError, "tap is blank!" if @tap.blank? path = @tap.new_formula_path(@name) raise "#{path} already exists" if path.exist?