From 391a888868260fee89d416f03b11210af1d8a228 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 20 Apr 2010 22:57:26 -0700 Subject: [PATCH] actually fix the cache pruning code --- lib/bundler/runtime.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index 6284aad04c5..09dd0c93504 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -97,9 +97,12 @@ def prune_cache FileUtils.mkdir_p(cache_path) Bundler.ui.info "Removing outdated .gem files from vendor/cache" - cache_path.children.each do |gemfile| - spec = Gem::Format.from_file_by_path(gemfile).spec - gemfile.rmtree unless specs.include?(spec) + cache_path.children.each do |gem_path| + cached_spec = Gem::Format.from_file_by_path(gem_path).spec + unless specs.any?{|s| s.full_name == cached_spec.full_name } + Bundler.ui.info " * #{File.basename(gem_path)}" + gem_path.rmtree + end end end