diff options
Diffstat (limited to 'lib/rubygems/commands/pristine_command.rb')
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index 64ea8ce91c..9a0b2e9f11 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -79,11 +79,13 @@ revert the gem. say "Restoring gem(s) to pristine condition..." specs.each do |spec| - gem = Dir[File.join(Gem.dir, 'cache', spec.file_name)].first + gem = spec.cache_gem if gem.nil? then - alert_error "Cached gem for #{spec.full_name} not found, use `gem install` to restore" - next + say "Cached gem for #{spec.full_name} not found, attempting to fetch..." + dep = Gem::Dependency.new spec.name, spec.version + Gem::RemoteFetcher.fetcher.download_to_cache dep + gem = spec.cache_gem end # TODO use installer options |