2007-11-01 06:14:56 +00:00
|
|
|
module Mongrel
|
|
|
|
module Gems
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def require(library, version = nil)
|
|
|
|
begin
|
2007-11-12 21:13:03 +00:00
|
|
|
Kernel.require library
|
2007-11-01 06:14:56 +00:00
|
|
|
rescue LoadError, RuntimeError => e
|
2007-11-12 21:13:03 +00:00
|
|
|
begin
|
2007-11-01 06:14:56 +00:00
|
|
|
# ActiveSupport breaks 'require' by making it always return a true value
|
|
|
|
require 'rubygems'
|
2007-11-12 21:13:03 +00:00
|
|
|
version ? gem(library, version) : gem(library)
|
|
|
|
retry
|
|
|
|
rescue Gem::LoadError, LoadError, RuntimeError
|
|
|
|
# puts "** #{library.inspect} could not be loaded" unless library == "mongrel_experimental"
|
2007-11-01 06:14:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|