123456789_123456789_123456789_123456789_123456789_

Class: Unicorn::App::OldRails

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/unicorn/app/old_rails.rb

Overview

Implements a handler that can run Rails.

Instance Method Summary

Instance Method Details

#call(env)

[ GitHub ]

  
# File 'lib/unicorn/app/old_rails.rb', line 21

def call(env)
  cgi = Unicorn::CGIWrapper.new(env)
  begin
    Dispatcher.dispatch(cgi,
        ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS,
        cgi.body)
  rescue => e
    err = env['rack.errors']
    err.write("#{e} #{e.message}\n")
    e.backtrace.each { |line| err.write("#{line}\n") }
  end
  cgi.out  # finalize the response
  cgi.rack_response
end