Sha256: ad9ce00476d5999366544dfedfb7716e8d608c34d9e1e716b5667bf3155996d2

Contents?: true

Size: 395 Bytes

Versions: 179

Compression:

Stored size: 395 Bytes

Contents

#!/usr/bin/env ruby

require 'stringio'

# Mix-in for capturing standard output.
module CaptureStdout
  def capture_stdout
    s = StringIO.new
    oldstdout = $stdout
    $stdout = s
    yield
    s.string
  ensure
    $stdout = oldstdout
  end

  def capture_stderr
    s = StringIO.new
    oldstderr = $stderr
    $stderr = s
    yield
    s.string
  ensure
    $stderr = oldstderr
  end
end

Version data entries

179 entries across 133 versions & 13 rubygems

Version Path
craigmarksmith-rake-0.8.3.100 test/capture_stdout.rb
craigmarksmith-rake-0.8.4.101 test/capture_stdout.rb
craigmarksmith-rake-0.8.4.102 test/capture_stdout.rb
craigmarksmith-rake-0.8.4.103 test/capture_stdout.rb
elliottcable-echoe-3.1.1 vendor/rake/test/capture_stdout.rb
elliottcable-echoe-3.1.2 vendor/rake/test/capture_stdout.rb
jandot-biorake-1.0 test/capture_stdout.rb
jimweirich-rake-0.8.1.10 test/capture_stdout.rb
jimweirich-rake-0.8.1.11 test/capture_stdout.rb
jimweirich-rake-0.8.1.5 test/capture_stdout.rb
jimweirich-rake-0.8.1.6 test/capture_stdout.rb
jimweirich-rake-0.8.1.7 test/capture_stdout.rb
jimweirich-rake-0.8.1.8 test/capture_stdout.rb
jimweirich-rake-0.8.1.9 test/capture_stdout.rb
jimweirich-rake-0.8.2.99 test/capture_stdout.rb
jimweirich-rake-0.8.2 test/capture_stdout.rb
jimweirich-rake-0.8.3.1 test/capture_stdout.rb
jimweirich-rake-0.8.3.100 test/capture_stdout.rb
jimweirich-rake-0.8.3.99 test/capture_stdout.rb
jimweirich-rake-0.8.3 test/capture_stdout.rb