From 9889b08360abf22f6dc71b3748e4b0387b3122f6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 25 May 2009 23:04:27 -0700 Subject: Switch to autoload to defer requires This should prevent Rack from being required too early on so "-I" being passed through the unicorn command-line can modify $LOAD_PATH for Rack --- lib/unicorn.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index da41399..cb36fc8 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -1,16 +1,17 @@ require 'fcntl' - require 'unicorn/socket_helper' -require 'unicorn/const' -require 'unicorn/http_request' -require 'unicorn/http_response' -require 'unicorn/configurator' -require 'unicorn/util' +autoload :Rack, 'rack' # Unicorn module containing all of the classes (include C extensions) for running # a Unicorn web server. It contains a minimalist HTTP server with just enough # functionality to service web application requests fast as possible. module Unicorn + autoload :Const, 'unicorn/const' + autoload :HttpRequest, 'unicorn/http_request' + autoload :HttpResponse, 'unicorn/http_response' + autoload :Configurator, 'unicorn/configurator' + autoload :Util, 'unicorn/util' + class << self def run(app, options = {}) HttpServer.new(app, options).start.join -- cgit v1.2.3-24-ge0c7