diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-09 14:53:27 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-09 14:53:27 -0800 |
commit | 55a4c22ba909a99f5da7d92945090c162fe0f4ef (patch) | |
tree | 6666ce689d98bdcc31eb9189ec4a0b6b482f7df1 | |
parent | 248ca3489de22f889a7243f571d8341c733cd52e (diff) | |
download | bundler-55a4c22ba909a99f5da7d92945090c162fe0f4ef.tar.gz |
Don't constantly reinstall packed gems
-rw-r--r-- | lib/bundler/installer.rb | 3 | ||||
-rw-r--r-- | spec/install/gems_spec.rb | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index e31ec1df..d58b7c64 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -131,11 +131,12 @@ module Bundler index = source.local_specs.merge(index) end + index = Index.from_installed_gems.merge(index) + if File.directory?("#{root}/vendor/cache") index = cache_source.specs.merge(index).freeze end - index = Index.from_installed_gems.merge(index) Index.from_cached_specs("#{Bundler.bundle_path}/cache").merge(index) end end diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index 0cf7c4e7..409ea341 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -373,6 +373,24 @@ describe "bundle install with gem sources" do bundle :install should_be_installed "rack 1.0.0" end + + it "does not constantly reinstall the gems" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + bundle "pack" + + build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s| + s.write "lib/rack.rb", "raise 'omg'" + end + + bundle "install" + + err.should be_empty + should_be_installed "rack 1.0" + end end describe "native dependencies" do |