diff options
author | Andre Arko <andre@arko.net> | 2010-04-20 22:57:26 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-20 23:14:04 -0700 |
commit | 391a888868260fee89d416f03b11210af1d8a228 (patch) | |
tree | 88d022f1d26253eaf059074b79842371f918c1b6 | |
parent | 7c9e331d83f48a3b1a8a22aeec5471da613f50a3 (diff) | |
download | bundler-391a888868260fee89d416f03b11210af1d8a228.tar.gz |
actually fix the cache pruning code
-rw-r--r-- | lib/bundler/runtime.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index 6284aad04c..09dd0c9350 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -97,9 +97,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 |