diff options
author | Terence Lee <hone02@gmail.com> | 2011-08-06 01:00:30 -0500 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2011-08-06 01:00:30 -0500 |
commit | 8e6bc165fa579a41461721c8f2df1bef6281c27a (patch) | |
tree | c78154d9965b0811cdd7b618004d269b63651242 /lib/bundler/rubygems_ext.rb | |
parent | b213de2fd640d3062ea16165a55d5590facc6a99 (diff) | |
parent | ba23f523c690fdd6d0f8ad37962f3a1f6d2a86c7 (diff) | |
download | bundler-8e6bc165fa579a41461721c8f2df1bef6281c27a.tar.gz |
Merge branch '1-0-stable'
Conflicts:
CHANGELOG.md
lib/bundler/templates/newgem/Rakefile.tt
lib/bundler/templates/newgem/newgem.gemspec.tt
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-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 f92cf5ce..27e9f2ab 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -141,6 +141,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 |