Move nostdout to lone calling class
This commit is contained in:
parent
ccabd3318e
commit
0d200944c8
@ -360,14 +360,6 @@ module Kernel
|
|||||||
$stderr = old
|
$stderr = old
|
||||||
end
|
end
|
||||||
|
|
||||||
def nostdout(&block)
|
|
||||||
if T.unsafe(self).verbose?
|
|
||||||
yield
|
|
||||||
else
|
|
||||||
redirect_stdout(File::NULL, &block)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def redirect_stdout(file)
|
def redirect_stdout(file)
|
||||||
out = $stdout.dup
|
out = $stdout.dup
|
||||||
$stdout.reopen(file)
|
$stdout.reopen(file)
|
||||||
|
|||||||
@ -58,4 +58,12 @@ class FormulaVersions
|
|||||||
ensure
|
ensure
|
||||||
Homebrew.raise_deprecation_exceptions = false
|
Homebrew.raise_deprecation_exceptions = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nostdout(&block)
|
||||||
|
if verbose?
|
||||||
|
yield
|
||||||
|
else
|
||||||
|
redirect_stdout(File::NULL, &block)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user