Sha256: 58936e581e583c33428c0c582d2b3e65d057bb1a3af109c3c3b782047ab6cbab

Contents?: true

Size: 359 Bytes

Versions: 6

Compression:

Stored size: 359 Bytes

Contents

# coding: utf-8
module CaptureStd
  def capture_stderr
    err, $stderr = $stderr, StringIO.new
    yield
    $stderr.string
  ensure
    $stderr = err
  end

  def capture_stdout
    out, $stdout = $stdout, StringIO.new
    yield
    $stdout.string
  ensure
    $stdout = out
  end

  def silence_stderr(&block)
    silence_stream($stderr, &block)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i18n-tasks-0.8.3 spec/support/capture_std.rb
i18n-tasks-0.8.2 spec/support/capture_std.rb
i18n-tasks-0.8.1 spec/support/capture_std.rb
i18n-tasks-0.8.0 spec/support/capture_std.rb
i18n-tasks-0.7.13 spec/support/capture_std.rb
i18n-tasks-0.7.12 spec/support/capture_std.rb