Module: Kernel

Defined in:
lib/cutter/kernel.rb

Overview

Instance Method Summary collapse

Instance Method Details

#capture_stdoutObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/cutter/kernel.rb', line 5

def capture_stdout
  out = StringIO.new
  $stdout = out

  yield

  out
ensure
  $stdout = STDOUT
end