Commit 86a8955c authored by Jasper Maes's avatar Jasper Maes

Rails 5: replace removed silence_stream

parent 68b84d81
---
title: 'Rails 5: replace removed silence_stream'
merge_request: 21387
author: Jasper Maes
type: other
...@@ -82,7 +82,7 @@ namespace :gettext do ...@@ -82,7 +82,7 @@ namespace :gettext do
# `gettext:find` writes touches to temp files to `stderr` which would cause # `gettext:find` writes touches to temp files to `stderr` which would cause
# `static-analysis` to report failures. We can ignore these. # `static-analysis` to report failures. We can ignore these.
silence_stream($stderr) do silence_sdterr do
Rake::Task['gettext:find'].invoke Rake::Task['gettext:find'].invoke
end end
...@@ -118,4 +118,15 @@ namespace :gettext do ...@@ -118,4 +118,15 @@ namespace :gettext do
end end
end end
end end
def silence_sdterr(&block)
old_stderr = $stderr.dup
$stderr.reopen(File::NULL)
$stderr.sync = true
yield
ensure
$stderr.reopen(old_stderr)
old_stderr.close
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment