From 25a9b62d45ddd60a231272567c7dda9337da9b62 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 1 Mar 2011 09:41:32 +0000 Subject: Import rubygems 1.6.0 (released version @ 58d8a0b9) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/test_utilities.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/rubygems/test_utilities.rb') diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb index 892e4dd9e5..43f905f017 100644 --- a/lib/rubygems/test_utilities.rb +++ b/lib/rubygems/test_utilities.rb @@ -104,7 +104,7 @@ class Gem::FakeFetcher def download spec, source_uri, install_dir = Gem.dir name = spec.file_name - path = File.join(install_dir, 'cache', name) + path = Gem.cache_gem(name, install_dir) Gem.ensure_gem_subdirectories install_dir @@ -119,6 +119,16 @@ class Gem::FakeFetcher path end + def download_to_cache dependency + found = Gem::SpecFetcher.fetcher.fetch dependency + + return if found.empty? + + spec, source_uri = found.first + + download spec, source_uri + end + end # :stopdoc: -- cgit v1.2.3