1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Add ruby IOBuffer for JRuby

This commit is contained in:
Evan Phoenix 2012-08-11 15:20:38 -07:00
parent ab8dbfeb96
commit 48593aeb2b
2 changed files with 37 additions and 0 deletions

33
lib/puma/io_buffer.rb Normal file
View file

@ -0,0 +1,33 @@
module Puma
class IOBuffer
def initialize
@buf = ""
end
def reset
@buf = ""
end
def <<(str)
@buf << str
end
def append(*strs)
strs.each { |s| @buf << s }
end
def to_s
@buf
end
alias_method :to_str, :to_s
def used
@buf.size
end
def capacity
@buf.size
end
end
end

View file

@ -14,6 +14,10 @@ require 'puma/accept_nonblock'
require 'puma/puma_http11'
unless Puma.const_defined? "IOBuffer"
require 'puma/io_buffer'
end
require 'socket'
module Puma