Sha256: 6f4568274108849506657c85b17573250095469882f42753be787c3636fbe04c
Contents?: true
Size: 289 Bytes
Versions: 2
Compression:
Stored size: 289 Bytes
Contents
# Captures given stream. # # @example # capture(:stdout) { do_something } # 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
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
uuids-1.4.1 | spec/support/development/helpers/capture.rb |
uuids-1.4.0 | spec/support/capture.rb |