123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Server::Helper Private

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: lib/rubocop/server/helper.rb

Overview

This module has a helper method for SocketReader.

Class Method Summary

Class Method Details

.redirect(stdin: $stdin, stdout: $stdout, stderr: $stderr, &_block)

[ GitHub ]

  
# File 'lib/rubocop/server/helper.rb', line 17

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