Class: WebrickServletCGIwrapper
- Inherits:
-
WEBrick::HTTPServlet::AbstractServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- WebrickServletCGIwrapper
- Includes:
- CGI::QueryExtension
- Defined in:
- lib/lapillus/webrick_server.rb
Instance Method Summary collapse
- #env_table ⇒ Object
-
#initialize(server, *options) ⇒ WebrickServletCGIwrapper
constructor
A new instance of WebrickServletCGIwrapper.
- #out(options = "text/html") ⇒ Object
- #service(req, res) ⇒ Object
- #stdinput ⇒ Object
Constructor Details
#initialize(server, *options) ⇒ WebrickServletCGIwrapper
Returns a new instance of WebrickServletCGIwrapper.
37 38 39 40 41 |
# File 'lib/lapillus/webrick_server.rb', line 37 def initialize(server,*) # puts "initialize(#{server},#{options.to_yaml}) called" super(server,*) @env=Hash.new # remove? end |
Instance Method Details
#env_table ⇒ Object
47 48 49 |
# File 'lib/lapillus/webrick_server.rb', line 47 def env_table @env end |
#out(options = "text/html") ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/lapillus/webrick_server.rb', line 51 def out( = "text/html") # puts "out(#{options.to_yaml} called" # puts "@output_cookies #{@output_cookies.to_yaml}" = { "type" => } if .kind_of?(String) content = yield @res.body = content .each{|key,val| @res[key]=val } @res..concat() end |
#service(req, res) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/lapillus/webrick_server.rb', line 64 def service(req, res) @res=res @env = req..clone @env.delete "SCRIPT_NAME" @env["QUERY_STRING"] = req.request_uri.query @env["REQUEST_URI"] = req.request_uri @stdin=StringIO.new(req.body || "") initialize_query() Dispatcher.dispatch(self,[0]) end |
#stdinput ⇒ Object
43 44 45 |
# File 'lib/lapillus/webrick_server.rb', line 43 def stdinput @stdin || $stdin # remove || $stdin end |