diff --git a/lib/mongrel.rb b/lib/mongrel.rb index a55d425e..8de2e97f 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -10,14 +10,17 @@ require 'stringio' begin require 'fastthread' -rescue RuntimeError => e - warn "fastthread not loaded: #{ e.message }" -rescue LoadError +rescue LoadError, RuntimeError + require 'rubygems' and retry ensure require 'thread' end -require 'cgi_multipart_eof_fix' +begin + require 'cgi_multipart_eof_fix' +rescue LoadError + require 'rubygems' and retry +end require 'mongrel/cgi' require 'mongrel/handlers' diff --git a/lib/mongrel/command.rb b/lib/mongrel/command.rb index 3a67d56f..64d25094 100644 --- a/lib/mongrel/command.rb +++ b/lib/mongrel/command.rb @@ -4,10 +4,14 @@ # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html # for more information. -require 'rubygems' require 'singleton' require 'optparse' -require 'gem_plugin' + +begin + require 'gem_plugin' +rescue LoadError + require 'rubygems' and retry +end module Mongrel diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index 334bdc4d..beaf7d01 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -39,6 +39,8 @@ module Mongrel # You pass in initial defaults and then a block to continue configuring. def initialize(defaults={}, &block) + p defaults + p instance_variables @listener = nil @listener_name = nil @listeners = {} diff --git a/lib/mongrel/init.rb b/lib/mongrel/init.rb index 7199d0c3..968f2cdf 100644 --- a/lib/mongrel/init.rb +++ b/lib/mongrel/init.rb @@ -4,10 +4,13 @@ # Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html # for more information. -require 'rubygems' -require 'gem_plugin' +begin + require 'gem_plugin' +rescue LoadError + require 'rubygems' and retry +end -# file is just a stub that makes sure the mongrel_plugins gem is loaded and ready +# File is just a stub that makes sure the mongrel_plugins gem is loaded and ready