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.
This commit is contained in:
Przemysław Kryger 2024-10-24 12:49:31 +01:00
parent ff03947ba0
commit f31e93a73a
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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)