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

Version Path
rack-app-6.8.0 lib/rack/app/request_stream.rb
rack-app-6.7.1 lib/rack/app/request_stream.rb
rack-app-6.7.0 lib/rack/app/request_stream.rb
rack-app-6.6.0 lib/rack/app/request_stream.rb
rack-app-6.5.0 lib/rack/app/request_stream.rb
rack-app-6.4.1 lib/rack/app/request_stream.rb
rack-app-6.4.0 lib/rack/app/request_stream.rb
rack-app-6.3.3 lib/rack/app/request_stream.rb
rack-app-6.3.2 lib/rack/app/request_stream.rb
rack-app-6.3.1 lib/rack/app/request_stream.rb
rack-app-6.3.0 lib/rack/app/request_stream.rb
rack-app-6.2.0 lib/rack/app/request_stream.rb
rack-app-6.1.0 lib/rack/app/request_stream.rb
rack-app-6.0.0 lib/rack/app/request_stream.rb
rack-app-5.12.0 lib/rack/app/request_stream.rb
rack-app-5.11.1 lib/rack/app/request_stream.rb
rack-app-5.11.0 lib/rack/app/request_stream.rb
rack-app-5.10.2 lib/rack/app/request_stream.rb
rack-app-5.10.1 lib/rack/app/request_stream.rb
rack-app-5.10.0 lib/rack/app/request_stream.rb