Created
June 3, 2010 23:32
-
-
Save bakineggs/424666 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment