aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-20 22:57:26 -0700
committerAndre Arko <andre@arko.net>2010-04-23 10:05:04 -0700
commitd0cc02b755d5f649e17f20fe4b8dcfd7c7bb52b6 (patch)
treecc0bdc3fbc0dd62cfa4691d6cac0d342d2c897d2 /lib
parent98c8e56e5f21c4a1c4c2b7a62a27407c6c117753 (diff)
downloadbundler-d0cc02b755d5f649e17f20fe4b8dcfd7c7bb52b6.tar.gz
actually fix the cache pruning code
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/runtime.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index db1ba72a..5df14983 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -81,9 +81,12 @@ module Bundler
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