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
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/request_stream.rb
rack-app-7.7.0 lib/rack/app/request_stream.rb
rack-app-7.6.5 lib/rack/app/request_stream.rb
rack-app-7.6.4 lib/rack/app/request_stream.rb
rack-app-7.6.3 lib/rack/app/request_stream.rb
rack-app-7.6.2 lib/rack/app/request_stream.rb
rack-app-7.6.1 lib/rack/app/request_stream.rb
rack-app-7.6.0 lib/rack/app/request_stream.rb
rack-app-7.5.2 lib/rack/app/request_stream.rb
rack-app-7.5.1 lib/rack/app/request_stream.rb
rack-app-7.5.0 lib/rack/app/request_stream.rb
rack-app-7.4.0 lib/rack/app/request_stream.rb
rack-app-7.3.2 lib/rack/app/request_stream.rb
rack-app-7.3.1 lib/rack/app/request_stream.rb
rack-app-7.3.0 lib/rack/app/request_stream.rb
rack-app-7.2.2 lib/rack/app/request_stream.rb
rack-app-7.2.1 lib/rack/app/request_stream.rb
rack-app-7.2.0 lib/rack/app/request_stream.rb
rack-app-7.1.0 lib/rack/app/request_stream.rb
rack-app-7.0.0 lib/rack/app/request_stream.rb