Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
actually fix the cache pruning code
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Apr 21, 2010
1 parent 7c9e331 commit 391a888
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/bundler/runtime.rb
Expand Up @@ -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

Expand Down

0 comments on commit 391a888

Please sign in to comment.