class Repobrowse::GitHTTPBackend::EachWrap

used to provide streaming Rack response body

Public Class Methods

new(io) click to toggle source
# File lib/repobrowse/git_http_backend.rb, line 12
def initialize(io)
  @io = io
end

Public Instance Methods

close() click to toggle source
# File lib/repobrowse/git_http_backend.rb, line 27
def close
  @io.close
end
each() { |buf| ... } click to toggle source
# File lib/repobrowse/git_http_backend.rb, line 16
def each
  begin
    buf = @io.readpartial(16384, buf)
    yield buf
  rescue EOFError
    return
  ensure
    buf&.clear
  end while true
end