1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/lib/mongrel/gems.rb
evanweaver e7e39dd886 oops... gems is quite necessary
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@865 19e92222-5c0b-0410-8929-a290d50e31e9
2007-11-01 06:14:56 +00:00

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