Skip to content
This repository
Browse code

fix bundle cache edge case for #1202

  • Loading branch information...
commit a23240d1cfb2b250a60f8b17a4fbc517f6811872 1 parent 3e71c5d
Terence Lee authored
10  lib/bundler/rubygems_integration.rb
@@ -265,6 +265,15 @@ def backport_segment_generation
265 265
       end
266 266
     end
267 267
 
  268
+    # This backport fixes the marshaling of @segments.
  269
+    def backport_yaml_initialize
  270
+      Gem::Version.send(:define_method, :yaml_initialize) do |tag, map|
  271
+        @version = map['version']
  272
+        @segments = nil
  273
+        @hash = nil
  274
+      end
  275
+    end
  276
+
268 277
     # This backports base_dir which replaces installation path
269 278
     # Rubygems 1.8+
270 279
     def backport_base_dir
@@ -301,6 +310,7 @@ def initialize
301 310
         backport_base_dir
302 311
         backport_cache_file
303 312
         backport_spec_file
  313
+        backport_yaml_initialize
304 314
       end
305 315
 
306 316
       def stub_rubygems(specs)
3  spec/realworld/edgecases_spec.rb
@@ -14,7 +14,8 @@
14 14
   it "bundle cache works with rubygems 1.3.7 and pre gems" do
15 15
     install_gemfile <<-G
16 16
       source :rubygems
17  
-      gem "rack", "1.3.0.beta2"
  17
+      gem "rack",          "1.3.0.beta2"
  18
+      gem "will_paginate", "3.0.pre2"
18 19
     G
19 20
     bundle :cache
20 21
     out.should_not include("Removing outdated .gem files from vendor/cache")

0 notes on commit a23240d

Please sign in to comment.
Something went wrong with that request. Please try again.