Sha256: 2ee33026fa63f45942dc4e82a232256c730b877b55797dbe51591e3b0631d75c
Contents?: true
Size: 348 Bytes
Versions: 40
Compression:
Stored size: 348 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
40 entries across 40 versions & 2 rubygems