Sha256: a50f7c7a4ceb79004d6aa1d730a68cad8d31cf49c9e6960471e0906239c53b9a

Contents?: true

Size: 255 Bytes

Versions: 22

Compression:

Stored size: 255 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

22 entries across 22 versions & 2 rubygems

Version Path
preek-1.7.0 spec/capture_helper.rb
preek-1.6.0 spec/capture_helper.rb
guard-preek-0.0.9 spec/capture_helper.rb
preek-1.5.1 spec/capture_helper.rb
guard-preek-0.0.8 spec/capture_helper.rb
preek-1.5.0 spec/capture_helper.rb
preek-1.4.3 spec/capture_helper.rb
preek-1.4.2 spec/capture_helper.rb
preek-1.4.1 spec/capture_helper.rb
guard-preek-0.0.7 spec/capture_helper.rb
preek-1.4.0 spec/capture_helper.rb
preek-1.3.2 spec/capture_helper.rb
guard-preek-0.0.6 spec/capture_helper.rb
guard-preek-0.0.5 spec/capture_helper.rb
preek-1.3.1 spec/capture_helper.rb
preek-1.2.1 spec/capture_helper.rb
guard-preek-0.0.4 spec/capture_helper.rb
guard-preek-0.0.3 spec/capture_helper.rb
preek-1.1.0 spec/capture_helper.rb
guard-preek-0.0.2 spec/capture_helper.rb