Move nostdout to lone calling class

This commit is contained in:
Douglas Eichelberger 2023-03-02 16:56:50 -08:00
parent ccabd3318e
commit 0d200944c8
2 changed files with 8 additions and 8 deletions

View File

@ -360,14 +360,6 @@ module Kernel
$stderr = old
end
def nostdout(&block)
if T.unsafe(self).verbose?
yield
else
redirect_stdout(File::NULL, &block)
end
end
def redirect_stdout(file)
out = $stdout.dup
$stdout.reopen(file)

View File

@ -58,4 +58,12 @@ class FormulaVersions
ensure
Homebrew.raise_deprecation_exceptions = false
end
def nostdout(&block)
if verbose?
yield
else
redirect_stdout(File::NULL, &block)
end
end
end