module Kernel

Public Instance Methods

capture_stderr() { || ... } click to toggle source
# File lib/luffa/patches/kernel.rb, line 11
def capture_stderr
  out = StringIO.new
  $stderr = out
  yield
  return out
ensure
  $stderr = STDERR
end
capture_stdout() { || ... } click to toggle source
# File lib/luffa/patches/kernel.rb, line 2
def capture_stdout
  out = StringIO.new
  $stdout = out
  yield
  return out
ensure
  $stdout = STDOUT
end