Created
May 2, 2014 17:34
-
-
Save eric1234/c9c818b972e0a9af61b8 to your computer and use it in GitHub Desktop.
Gem.cache polyfill - For running REALLY old Rails applications (1.2.x) under newer versions of RubyGems.
This file contains 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
# I put this right after rubygems is loaded in my boot.rb file | |
def Gem.cache | |
cache = Object.new | |
def cache.search name, *requirements | |
Gem::Specification.find_all_by_name name, *requirements | |
end | |
def cache.find *args, &blk | |
Gem::Specification.all.find *args, &blk | |
end | |
cache | |
end unless Gem.respond_to? :cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment