Commit e30e54b9 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'rails5-silence-stream' into 'master'

Rails 5: replace removed silence_stream

See merge request gitlab-org/gitlab-ce!21387
parents 04845fde 86a8955c
---
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