Browse files

Merge branch '1-0-stable'

Conflicts:
	CHANGELOG.md
	lib/bundler/version.rb
  • Loading branch information...
2 parents a20a8f7 + 66e930c commit 401982e466d7f14ac93ff66378e289fee05dd0a4 @hone hone committed Aug 8, 2011
Showing with 30 additions and 17 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 Rakefile
  3. +0 −14 lib/bundler/rubygems_ext.rb
  4. +22 −2 lib/bundler/rubygems_integration.rb
View
7 CHANGELOG.md
@@ -84,6 +84,13 @@ Removed:
- Removed bundle install --production
- Removed bundle install --disable-shared-gems
+## 1.0.17 (Aug 8, 2011)
+
+Bugfixes:
+
+ - Fix rake issues with rubygems 1.3.x (#1342)
+ - Fixed invalid byte sequence error while installing gem on Ruby 1.9 (#1341)
+
## 1.0.16 (Aug 8, 2011)
Features:
View
2 Rakefile
@@ -42,7 +42,7 @@ begin
namespace :rubygems do
# Rubygems specs by version
rubyopt = ENV["RUBYOPT"]
- %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.3).each do |rg|
+ %w(master v1.3.6 v1.3.7 v1.4.2 v1.5.3 v1.6.2 v1.7.2 v1.8.7).each do |rg|
desc "Run specs with Rubygems #{rg}"
RSpec::Core::RakeTask.new(rg) do |t|
t.rspec_opts = %w(-fs --color)
View
14 lib/bundler/rubygems_ext.rb
@@ -142,20 +142,6 @@ 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
View
24 lib/bundler/rubygems_integration.rb
@@ -250,7 +250,17 @@ def replace_entrypoints(specs)
Gem.clear_paths
end
- # Rubygems versions 1.3.6 through 1.6.2
+ # This backports the correct segment generation code from Rubygems 1.4+
+ # by monkeypatching it into the method in Rubygems 1.3.6 and 1.3.7.
+ def backport_segment_generation
+ Gem::Version.send(:define_method, :segments) do
+ @segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
+ /^\d+$/ =~ s ? s.to_i : s
+ end
+ end
+ end
+
+ # Rubygems 1.4 through 1.6
class Legacy < RubygemsIntegration
def stub_rubygems(specs)
stub_source_index137(specs)
@@ -265,6 +275,14 @@ def find_name(name)
end
end
+ # Rubygems versions 1.3.6 and 1.3.7
+ class Ancient < Legacy
+ def initialize
+ super
+ backport_segment_generation
+ end
+ end
+
# Rubygems 1.7
class Transitional < Legacy
def stub_rubygems(specs)
@@ -313,8 +331,10 @@ def preserve_paths
@rubygems = RubygemsIntegration::AlmostModern.new
elsif Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.7.0')
@rubygems = RubygemsIntegration::Transitional.new
- else # Rubygems 1.3.6 through 1.6.2
+ elsif Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.4.0')
@rubygems = RubygemsIntegration::Legacy.new
+ else # Rubygems 1.3.6 and 1.3.7
+ @rubygems = RubygemsIntegration::Ancient.new
end
class << self

0 comments on commit 401982e

Please sign in to comment.