Module: RuboCop::Daemon::Helper
- Defined in:
- lib/rubocop/daemon/helper.rb
Class Method Summary collapse
Class Method Details
.redirect(stdin: $stdin, stdout: $stdout, stderr: $stderr, &_block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rubocop/daemon/helper.rb', line 6 def self.redirect(stdin: $stdin, stdout: $stdout, stderr: $stderr, &_block) old_stdin = $stdin.dup old_stdout = $stdout.dup old_stderr = $stderr.dup $stdin = stdin $stdout = stdout $stderr = stderr yield ensure $stdin = old_stdin $stdout = old_stdout $stderr = old_stderr end |