mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
3fc88a2454
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-1@898 19e92222-5c0b-0410-8929-a290d50e31e9
22 lines
No EOL
629 B
Ruby
22 lines
No EOL
629 B
Ruby
module Mongrel
|
|
module Gems
|
|
class << self
|
|
|
|
def require(library, version = nil)
|
|
begin
|
|
Kernel.require library
|
|
rescue LoadError, RuntimeError => e
|
|
begin
|
|
# ActiveSupport breaks 'require' by making it always return a true value
|
|
Kernel.require 'rubygems'
|
|
version ? gem(library, version) : gem(library)
|
|
retry
|
|
rescue Gem::LoadError, LoadError, RuntimeError
|
|
# puts "** #{library.inspect} could not be loaded" unless library == "mongrel_experimental"
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end |