Class: Tofu::CGITofulet

Inherits:
WEBrick::CGI
  • Object
show all
Defined in:
lib/tofu.rb

Instance Method Summary collapse

Constructor Details

#initialize(bartender, *args) ⇒ CGITofulet

Returns a new instance of CGITofulet.



462
463
464
465
# File 'lib/tofu.rb', line 462

def initialize(bartender, *args)
  @bartender = bartender
  super(*args)
end

Instance Method Details

#service(req, res) ⇒ Object



467
468
469
# File 'lib/tofu.rb', line 467

def service(req, res)
  Context.new(req, res).service(@bartender)
end

#start(env, stdin, stdout) ⇒ Object



471
472
473
474
475
476
477
478
479
# File 'lib/tofu.rb', line 471

def start(env, stdin, stdout)
  if env["SERVER_SOFTWARE"]
    @config[:ServerSoftware] = env["SERVER_SOFTWARE"]
  end
  if %r{HTTP/(\d+\.\d+)} =~ env["SERVER_PROTOCOL"]
    @config[:HTTPVersion] = $1
  end
  super(env, stdin, stdout)
end