2 use Rainbows::DevFdResponse
3 class ClosablePipe < ::IO
7 rv = popen "echo hello", "rb"
14 $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n"
18 class ClosableFile < ::File
23 $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n"
37 $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n"
45 [ %w(Content-Length 6), %w(Content-Type text/plain)],
49 f = ClosableFile.open("env.ru", "rb")
52 'X-Req-Path' => env["PATH_INFO"],
53 'Content-Length' => f.stat.size.to_s,
54 'Content-Type' => 'text/plain' },
59 [%w(Content-Length 5), %w(Content-Type text/plain)],
63 [ 404, [%w(Content-Length 0), %w(Content-Type text/plain)], [] ]