mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
e7e39dd886
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@865 19e92222-5c0b-0410-8929-a290d50e31e9
23 lines
No EOL
546 B
Ruby
23 lines
No EOL
546 B
Ruby
module Mongrel
|
|
module Gems
|
|
class << self
|
|
|
|
alias :original_require :require
|
|
|
|
def require(library, version = nil)
|
|
begin
|
|
original_require library
|
|
rescue LoadError, RuntimeError => e
|
|
unless respond_to? 'gem'
|
|
# ActiveSupport breaks 'require' by making it always return a true value
|
|
require 'rubygems'
|
|
gem library, version if version
|
|
retry
|
|
end
|
|
# Fail without reraising
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end |