diff options
author | Terence Lee <hone02@gmail.com> | 2011-08-05 18:36:03 -0500 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2011-08-05 18:36:35 -0500 |
commit | 833c601cf13392f30b3104893f89b407f0819232 (patch) | |
tree | c720b0a027a8532ba5ffd021c1cb9fa361141eec /lib | |
parent | 2d11e108a14e6bd31d1266d80fc5fd63a58e893d (diff) | |
download | bundler-833c601cf13392f30b3104893f89b407f0819232.tar.gz |
fix for bundle package with rubygems 1.3.x, thanks @dburt
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 95a382f0..a4a38ecd 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -157,6 +157,21 @@ module Gem 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 |