Permalink
Browse files

fix for bundle package with rubygems 1.3.x, thanks @dburt

  • Loading branch information...
hone committed Aug 5, 2011
1 parent 2d11e10 commit 833c601cf13392f30b3104893f89b407f0819232
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/bundler/rubygems_ext.rb
@@ -157,6 +157,21 @@ def hash
alias eql? ==
end
+
+ # fix bug in Rubygems < 1.4 by forcing calculation of @segments
+ if Gem::Version.new(Gem::VERSION) < Gem::Version.new("1.4.0")
+ class Version
+ def segments # :nodoc:
+ unless @segments_generated
+ @segments = @version.scan(/[0-9]+|[a-z]+/i).map do |s|
+ /^\\\\d+$/ =~ s ? s.to_i : s
+ end
+ end
+ @segments_generated = true
+ @segments
+ end
+ end
+ end
end
module Bundler

0 comments on commit 833c601

Please sign in to comment.