From 59b441e718299f856260c93fff3451c7f4cda0da Mon Sep 17 00:00:00 2001 From: Marius Kleiner Date: Sun, 30 Mar 2025 17:09:01 +0200 Subject: [PATCH 1/4] Don't fail if GitHub repo homepage is not present --- Library/Homebrew/formula_creator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index d8e2234a86..f027a51d13 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -93,7 +93,7 @@ module Homebrew if @github @desc = @github["description"] - @homepage = if @github["homepage"].empty? + @homepage = if @github["homepage"].to_s.empty? "https://github.com/#{@github["full_name"]}" else @github["homepage"] From 426336a6aee474359a8b404ed7a63f4233d2826c Mon Sep 17 00:00:00 2001 From: Marius Kleiner Date: Sun, 30 Mar 2025 18:01:02 +0200 Subject: [PATCH 2/4] Simplify nil check --- Library/Homebrew/formula_creator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index f027a51d13..1cf7286c53 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -93,7 +93,7 @@ module Homebrew if @github @desc = @github["description"] - @homepage = if @github["homepage"].to_s.empty? + @homepage = if @github["homepage"].nil? "https://github.com/#{@github["full_name"]}" else @github["homepage"] From 812f953d39ed1e60520044fa6f79f6b4e81fc8d7 Mon Sep 17 00:00:00 2001 From: Marius Kleiner Date: Sun, 30 Mar 2025 18:08:20 +0200 Subject: [PATCH 3/4] Even simpler check for nil/empty string/etc. --- Library/Homebrew/formula_creator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 1cf7286c53..4ab4146132 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -93,7 +93,7 @@ module Homebrew if @github @desc = @github["description"] - @homepage = if @github["homepage"].nil? + @homepage = if @github["homepage"].blank? "https://github.com/#{@github["full_name"]}" else @github["homepage"] From c18dab0e2c1de579c5da36c5fc6619988732a278 Mon Sep 17 00:00:00 2001 From: Marius Kleiner Date: Sun, 30 Mar 2025 18:15:00 +0200 Subject: [PATCH 4/4] Fix style errors --- Library/Homebrew/formula_creator.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 4ab4146132..6bd6b0fdde 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -93,11 +93,7 @@ module Homebrew if @github @desc = @github["description"] - @homepage = if @github["homepage"].blank? - "https://github.com/#{@github["full_name"]}" - else - @github["homepage"] - end + @homepage = @github["homepage"].presence || "https://github.com/#{@github["full_name"]}" @license = @github["license"]["spdx_id"] if @github["license"] end end