FastCGI Wrapper for ruby

- a trick to wrap CGI in FastCGI easily

Author: Tatsuki Sugiura <[email protected]>

Licence: Ruby’s


Just copy fcgiwrap.rb to ruby's libdir or cgi's current directory.


This library was written for wrapping CGI to FastCGI without

FCGIWrap provides just FCGIWrap.each method. The method receives
a block and call it for each fcgi request. In this loop, CGI::new()
was overrided, then it will return instance of fcgi.


Write a wrapper script.
If you want to wrap foo.cgi, write foo.fcgi like following;

   require 'fcgiwrap'
   FCGIWrap.each {
     load '/path/to/foo.cgi'


Currently, FCGIWrap can not support some CGIs;
 - using global variable without initialization
 - substitution of constant in main routine of cgi
   (ruby will output warning).