about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--bin/mongrel_rails2
-rw-r--r--lib/mongrel.rb1
-rw-r--r--lib/mongrel/const.rb2
-rw-r--r--lib/mongrel/gems.rb13
4 files changed, 9 insertions, 9 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index 9d318e5..bb3205a 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -11,6 +11,8 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
 require 'mongrel'
 require 'mongrel/rails'
 
+Mongrel::Gems.require 'gem_plugin'
+
 # require 'ruby-debug'
 # Debugger.start
 
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index 6260ef9..e0dcab1 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -9,7 +9,6 @@ require 'stringio'
 
 require 'mongrel/gems'
 
-Mongrel::Gems.require 'gem_plugin'
 Mongrel::Gems.require 'cgi_multipart_eof_fix'
 Mongrel::Gems.require 'fastthread'
 require 'thread'
diff --git a/lib/mongrel/const.rb b/lib/mongrel/const.rb
index f714b67..6c6742b 100644
--- a/lib/mongrel/const.rb
+++ b/lib/mongrel/const.rb
@@ -65,7 +65,7 @@ module Mongrel
     REQUEST_URI='REQUEST_URI'.freeze
     REQUEST_PATH='REQUEST_PATH'.freeze
 
-    MONGREL_VERSION="1.1".freeze
+    MONGREL_VERSION="1.1.1".freeze
 
     MONGREL_TMP_BASE="mongrel".freeze
 
diff --git a/lib/mongrel/gems.rb b/lib/mongrel/gems.rb
index 4b34552..c1264bb 100644
--- a/lib/mongrel/gems.rb
+++ b/lib/mongrel/gems.rb
@@ -2,19 +2,18 @@ module Mongrel
   module Gems
     class << self
     
-      alias :original_require :require
-    
       def require(library, version = nil)
         begin
-          original_require library
+          Kernel.require library
         rescue LoadError, RuntimeError => e
-          unless respond_to? 'gem'
+          begin
             # ActiveSupport breaks 'require' by making it always return a true value
             require 'rubygems'
-            gem library, version if version
-            retry
+            version ? gem(library, version) : gem(library)
+            retry
+          rescue Gem::LoadError, LoadError, RuntimeError
+            # puts "** #{library.inspect} could not be loaded" unless library == "mongrel_experimental"
           end
-          # Fail without reraising
         end  
       end