Sha256: 88f0df66c81efb4a65e4c8de0524542a15dae1068f32e0eed7ecfa551b2c12d7

Contents?: true

Size: 257 Bytes

Versions: 4

Compression:

Stored size: 257 Bytes

Contents

module CaptureHelper
  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fdoc-0.3.3 spec/support/capture_helper.rb
fdoc-0.3.2 spec/support/capture_helper.rb
fdoc-0.3.1 spec/support/capture_helper.rb
fdoc-0.3.0 spec/support/capture_helper.rb