Sha256: 8b76f3a4307f879ed2481ba063a04a9541e596cd291726170410c74f5d42c56e

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

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

#--
# Adapt the default CGI object to suit Nitro.
#++

class CGI # :nodoc: all
  def env
    ENV
  end
end

# Speeds things up, more comaptible with OSX.

Socket.do_not_reverse_lookup = true

module Nitro

# A plain CGI adapter. To be used only in development 
# environments, this adapter is *extremely* slow for
# live/production environments. This adapter is provided for
# the sake of completeness.

class CgiAdapter
  #--
  # No need for connection pooling, CGI uses process.
  #++
  
  def self.start(server)
    cgi = CGI.new
    Router.strip_path = cgi.env["SCRIPT_NAME"]
    Cgi.process(server, cgi, $stdin, $stdout)
  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.27.0 lib/nitro/adapter/cgi.rb