class Unicorn::Prewarm::FakeSocket
Constants
- HTTP_VERSION
Public Class Methods
new(req, version = HTTP_VERSION, path = req.path)
click to toggle source
# File lib/unicorn/prewarm.rb, line 32 def initialize(req, version = HTTP_VERSION, path = req.path) @req = req @version = version @path = path @out = StringIO.new end
Public Instance Methods
closed?()
click to toggle source
# File lib/unicorn/prewarm.rb, line 58 def closed? true end
kgio_addr()
click to toggle source
# File lib/unicorn/prewarm.rb, line 45 def kgio_addr '127.0.0.1' end
kgio_read!(_size, buff = '')
click to toggle source
# File lib/unicorn/prewarm.rb, line 39 def kgio_read!(_size, buff = '') sock = StringIO.new(buff) @req.send(:write_header, sock, @version, @path) buff end
response()
click to toggle source
# File lib/unicorn/prewarm.rb, line 53 def response res = NetStringIO.new(@out.string) Net::HTTPResponse.read_new(res) end
write(line)
click to toggle source
# File lib/unicorn/prewarm.rb, line 49 def write(line) @out << line end