123456789_123456789_123456789_123456789_123456789_

Class: WEBrick::HTTPServlet::CGIHandler

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: WEBrick::HTTPServlet::AbstractServlet
Defined in: lib/webrick/httpservlet/cgihandler.rb

Overview

Servlet for handling ::WEBrick::CGI scripts

Example:

server.mount('/cgi/my_script', WEBrick::HTTPServlet::CGIHandler,
             '/path/to/my_script')

Class Method Summary

AbstractServlet - Inherited

.get_instance

Factory for servlet instances that will handle a request from server using options from the mount point.

.new

Initializes a new servlet for server using options which are stored as-is in @options.

Instance Method Summary

AbstractServlet - Inherited

#do_GET

Raises a NotFound exception.

#do_HEAD

Dispatches to do_GET.

#do_OPTIONS

Returns the allowed HTTP request methods.

#service

Dispatches to a do_ method based on req if such a method is available.

#redirect_to_directory_uri

Redirects to a path ending in /.

Constructor Details

.new(server, name) ⇒ CGIHandler

Creates a new ::WEBrick::CGI script servlet for the script at name

[ GitHub ]

  
# File 'lib/webrick/httpservlet/cgihandler.rb', line 34

def initialize(server, name)
  super(server, name)
  @script_filename = name
  @tempdir = server[:TempDir]
  @cgicmd = "#{CGIRunner} #{server[:CGIInterpreter]}"
end