Class: Cgi_is_retarded

Inherits:
Object
  • Object
show all
Defined in:
lib/scripts/knjappserver_cgi.rb

Overview

This scripts start an appserver, executes a HTTP-request and terminates. Good for programming appserver-supported projects without running an appserver all the time, but really slow because of startup for every request.

Instance Method Summary collapse

Instance Method Details

#cgiObject



22
23
24
25
# File 'lib/scripts/knjappserver_cgi.rb', line 22

def cgi
  @cgi = CGI.new if !@cgi
  return @cgi
end

#content_typeObject



18
19
20
# File 'lib/scripts/knjappserver_cgi.rb', line 18

def content_type
  return ENV["CONTENT_TYPE"]
end

#env_tableObject



10
11
12
# File 'lib/scripts/knjappserver_cgi.rb', line 10

def env_table
  return ENV
end

#paramsObject



27
28
29
# File 'lib/scripts/knjappserver_cgi.rb', line 27

def params
  return self.cgi.params
end


31
32
33
# File 'lib/scripts/knjappserver_cgi.rb', line 31

def print(arg)
  Kernel.print arg.to_s
end

#request_methodObject



14
15
16
# File 'lib/scripts/knjappserver_cgi.rb', line 14

def request_method
  return ENV["REQUEST_METHOD"]
end