Sha256: 3dcdf1468f9bac0f88b157546af7f4b2e2beb6c9fbaf1be047d6c78afb2f88a8
Contents?: true
Size: 555 Bytes
Versions: 6
Compression:
Stored size: 555 Bytes
Contents
# frozen_string_literal: true module Whatup module Server module Redirection # Reroutes stdin and stdout inside a block # # @param [IO#write] stdin - will redirect stdin to this # @param [IO#write] stdout - will redirect stdout to this def redirect stdin: $stdin, stdout: $stdout original_stdin = $stdin original_stdout = $stdout $stdin = stdin $stdout = stdout yield ensure $stdin = original_stdin $stdout = original_stdout end end end end
Version data entries
6 entries across 6 versions & 1 rubygems