Sha256: 753f9105a75ad160e7a6d525f7481c68ae33daf7e3f39b368a8b1cf66f634e00
Contents?: true
Size: 350 Bytes
Versions: 8
Compression:
Stored size: 350 Bytes
Contents
require "enumerator" class Rack::App::RequestStream include Enumerable def initialize(io, parser) @io = io @parser = parser end def each(&block) enum = Enumerator.new do |y| # @io.rewind while chunk = @io.gets y << @parser.call(chunk) end end block_given? ? enum.each(&block) : enum end end
Version data entries
8 entries across 8 versions & 1 rubygems