Sha256: e7413d8c88f38c02fcab8b3185069dc14b08a7fad0a398ab783e7dc4045eb58f

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

require 'cgi'
require 'stringio'
require 'tempfile'

# Speeds things up, more comaptible with OSX.

Socket.do_not_reverse_lookup = true

module Nitro

class CgiAdapter
  #--
  # No need for connection pooling, CGI uses process.
  #++
  
  def self.start(server)
    cgi = CGI.new
    def cgi.env
      env_table
    end
    Router.strip_path = cgi.env["SCRIPT_NAME"]
    Cgi.process(server, cgi, cgi, cgi)
=begin    
    context = Context.new(server)
    context.headers = ENV
    
    CgiUtils.parse_params(context)
    CgiUtils.parse_cookies(context)

    context.render(context.path)

    cgi.print(CgiUtils.response_headers(context))
    cgi.print(context.out)
=end
  end
  
end

end

# * James Britt <james_b@neurogami.com>
# * George Moschovitis <gm@navel.gr>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.26.0 lib/nitro/adapter/cgi.rb