summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-05-25 23:04:27 -0700
committerEric Wong <normalperson@yhbt.net>2009-05-25 23:04:27 -0700
commit9889b08360abf22f6dc71b3748e4b0387b3122f6 (patch)
tree334c5315e3b51a55dc5e0b044a41dd9749b17677
parent792064a4aeeab887d7ffcc9dda3fbd8f22488c82 (diff)
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
-rw-r--r--lib/unicorn.rb13
-rw-r--r--lib/unicorn/const.rb3
-rw-r--r--test/test_helper.rb2
3 files changed, 9 insertions, 9 deletions
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
diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb
index 52d1775..91f0d82 100644
--- a/lib/unicorn/const.rb
+++ b/lib/unicorn/const.rb
@@ -1,6 +1,3 @@
-
-require 'rack/utils'
-
 module Unicorn
 
   # Frequently used constants when constructing requests or responses.  Many times
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 55aa70c..787adbf 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -25,7 +25,9 @@ require 'stringio'
 require 'pathname'
 require 'tempfile'
 require 'fileutils'
+require 'logger'
 require 'unicorn'
+require 'unicorn/http11'
 
 if ENV['DEBUG']
   require 'ruby-debug'