From f31e93a73aab025e60a4a798031c73327cef45cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Kryger?= Date: Thu, 24 Oct 2024 12:49:31 +0100 Subject: [PATCH] Disable audit_result in inreplace This is to allow migration of existing users of @@HOMEBREW_PREFIX@@ tag in external patches. Once the automatic replacement of the tag is in stable branch and existing users are fixed (inreplace calls removed), this commit can be reverted. --- Library/Homebrew/test/utils/inreplace_spec.rb | 2 +- Library/Homebrew/utils/inreplace.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/test/utils/inreplace_spec.rb b/Library/Homebrew/test/utils/inreplace_spec.rb index a6b0a044b5..ba1e825a35 100644 --- a/Library/Homebrew/test/utils/inreplace_spec.rb +++ b/Library/Homebrew/test/utils/inreplace_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Utils::Inreplace do it "raises error if there is nothing to replace" do expect do described_class.inreplace file.path, "d", "f" - end.to raise_error(Utils::Inreplace::Error) + end.not_to raise_error(Utils::Inreplace::Error) end it "raises error if there is nothing to replace in block form" do diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index a7e3e9bddf..504fa6748c 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -50,7 +50,7 @@ module Utils block: T.nilable(T.proc.params(s: StringInreplaceExtension).void), ).void } - def self.inreplace(paths, before = nil, after = nil, audit_result: true, &block) + def self.inreplace(paths, before = nil, after = nil, audit_result: false, &block) paths = Array(paths) after &&= after.to_s before = before.to_s if before.is_a?(Pathname)