Permalink
Browse files

actually fix the cache pruning code

  • Loading branch information...
1 parent 7c9e331 commit 391a888868260fee89d416f03b11210af1d8a228 @indirect indirect committed Apr 21, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 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

0 comments on commit 391a888

Please sign in to comment.