Move nostdout to lone calling class
This commit is contained in:
parent
ccabd3318e
commit
0d200944c8
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user