diff options
author | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-08-26 19:41:18 +0200 |
---|---|---|
committer | Jasper Maes <jaspermaes.jm@gmail.com> | 2018-08-28 13:47:40 +0200 |
commit | 86a8955cf35b34b5a866d69f0766877e4e26e0f7 (patch) | |
tree | 496228c1f282fa1abbc707f5d1487e59b51bae31 /lib/tasks | |
parent | 68b84d8154a92876fb2c308b2ca16eb78f2b3933 (diff) | |
download | gitlab-ce-86a8955cf35b34b5a866d69f0766877e4e26e0f7.tar.gz |
Rails 5: replace removed silence_stream
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gettext.rake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index f431352b61e..a497d26312e 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -82,7 +82,7 @@ namespace :gettext do # `gettext:find` writes touches to temp files to `stderr` which would cause # `static-analysis` to report failures. We can ignore these. - silence_stream($stderr) do + silence_sdterr do Rake::Task['gettext:find'].invoke end @@ -118,4 +118,15 @@ namespace :gettext do 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 |