Sha256: 2bcbbc752531980aebe18377c9ada5e52d6fb63c94da5f33ee2b0be692f13858

Contents?: true

Size: 310 Bytes

Versions: 1

Compression:

Stored size: 310 Bytes

Contents

require 'stringio'

module Helpers
  def capture(*streams)
    streams.map!(&:to_s)
    begin
      result = StringIO.new
      streams.each { |stream| eval "$#{stream} = result" }
      yield
    ensure
      streams.each { |stream| eval("$#{stream} = #{stream.upcase}") }
    end
    result.string
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
guard-rails-assets-0.1.6 spec/support/stdout_helper.rb