diff options
author | Terence Lee <hone02@gmail.com> | 2012-03-13 22:25:14 -0500 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2012-03-13 22:27:56 -0500 |
commit | a23240d1cfb2b250a60f8b17a4fbc517f6811872 (patch) | |
tree | ba3cfcae4f6208d148a16ff165ef9b82f6229fa7 | |
parent | 3e71c5df913153247d3a4d205ef77a281ba87e69 (diff) | |
download | bundler-a23240d1cfb2b250a60f8b17a4fbc517f6811872.tar.gz |
fix bundle cache edge case for #1202
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 10 | ||||
-rw-r--r-- | spec/realworld/edgecases_spec.rb | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index c3ebf2038f..d0ad0359b7 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -265,6 +265,15 @@ module Bundler end end + # This backport fixes the marshaling of @segments. + def backport_yaml_initialize + Gem::Version.send(:define_method, :yaml_initialize) do |tag, map| + @version = map['version'] + @segments = nil + @hash = nil + end + end + # This backports base_dir which replaces installation path # Rubygems 1.8+ def backport_base_dir @@ -301,6 +310,7 @@ module Bundler backport_base_dir backport_cache_file backport_spec_file + backport_yaml_initialize end def stub_rubygems(specs) diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb index 1bb05425c9..6a2ab67935 100644 --- a/spec/realworld/edgecases_spec.rb +++ b/spec/realworld/edgecases_spec.rb @@ -14,7 +14,8 @@ describe "real world edgecases", :realworld => true do it "bundle cache works with rubygems 1.3.7 and pre gems" do install_gemfile <<-G source :rubygems - gem "rack", "1.3.0.beta2" + gem "rack", "1.3.0.beta2" + gem "will_paginate", "3.0.pre2" G bundle :cache out.should_not include("Removing outdated .gem files from vendor/cache") |