Permalink
Browse files

actually fix the cache pruning code

  • Loading branch information...
1 parent 98c8e56 commit d0cc02b755d5f649e17f20fe4b8dcfd7c7bb52b6 @indirect indirect committed Apr 21, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/bundler/runtime.rb
View
@@ -81,9 +81,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

0 comments on commit d0cc02b

Please sign in to comment.