* revert r38053 because it causes too many test failures.

if you've already installed r38053 or later, remove the installed
  lib/ruby/gems/2.0.0 directory and reinstall this revision or later.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2012-11-30 13:00:23 +00:00
parent 759619ca86
commit 5d33dad16c
3 changed files with 18 additions and 95 deletions

View File

@ -1,3 +1,9 @@
Fri Nov 30 21:57:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* revert r38053 because it causes too many test failures.
if you've already installed r38053 or later, remove the installed
lib/ruby/gems/2.0.0 directory and reinstall this revision or later.
Fri Nov 30 21:07:56 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/test/unit/parallel.rb (Test::Unit::Worker.run): wrap LoadError

View File

@ -1,5 +1,5 @@
# gem base directory versioning file [executable files under bin]
rake lib/rake lib/rake/version.rb [rake]
rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
minitest lib/minitest lib/minitest/unit.rb
json ext/json ext/json/lib/json/version.rb
# gem versioning file [executable files under bin]
rake lib/rake/version.rb [rake]
rdoc lib/rdoc.rb [rdoc ri]
minitest lib/minitest/unit.rb
json ext/json/lib/json/version.rb

View File

@ -562,95 +562,24 @@ module Gem
src.sub!(/\A#.*/, '')
eval(src, nil, path)
end
def to_ruby
<<-GEMSPEC
Gem::Specification.new do |s|
s.name = #{name.dump}
s.version = #{version.dump}
s.summary = #{summary.dump}
s.description = #{description.dump}
s.homepage = #{homepage.dump}
s.authors = #{authors.inspect}
s.email = #{email.inspect}
s.files = #{files.inspect}
end
GEMSPEC
end
end
end
module RbInstall
module Specs
class FileCollector
def initialize(base_dir)
@base_dir = base_dir
end
def collect
ruby_libraries + built_libraries
end
private
def type
/\/(ext|lib)?\/.*?\z/ =~ @base_dir
$1
end
def ruby_libraries
case type
when "ext"
prefix = "#{$extout}/common/"
base = "#{prefix}#{relative_base}"
when "lib"
base = @base_dir
prefix = base.sub(/lib\/.*?\z/, "") + "lib/"
end
Dir.glob("#{base}{.rb,/**/*.rb}").collect do |ruby_source|
remove_prefix(prefix, ruby_source)
end
end
def built_libraries
case type
when "ext"
prefix = "#{$extout}/#{CONFIG['arch']}/"
base = "#{prefix}#{relative_base}"
Dir.glob("#{base}{.so,/**/*.so}").collect do |built_library|
remove_prefix(prefix, built_library)
end
when "lib"
[]
end
end
def relative_base
/\/#{Regexp.escape(type)}\/(.*?)\z/ =~ @base_dir
$1
end
def remove_prefix(prefix, string)
string.sub(/\A#{Regexp.escape(prefix)}/, "")
end
end
class Reader < Struct.new(:src)
def gemspec
@gemspec ||= begin
spec = Gem::Specification.load(src) || raise("invalid spec in #{src}")
file_collector = FileCollector.new(File.dirname(src))
spec.files = file_collector.collect
spec
Gem::Specification.load(src) || raise("invalid spec in #{src}")
end
end
def spec_source
@gemspec.to_ruby
File.read src
end
end
class Generator < Struct.new(:name, :base_dir, :src, :execs)
class Generator < Struct.new(:name, :src, :execs)
def gemspec
@gemspec ||= eval spec_source
end
@ -662,7 +591,6 @@ Gem::Specification.new do |s|
s.version = #{version.dump}
s.summary = "This #{name} is bundled with Ruby"
s.executables = #{execs.inspect}
s.files = #{files.inspect}
end
GEMSPEC
end
@ -674,11 +602,6 @@ end
} or return
version.split(%r"=\s*", 2)[1].strip[/\A([\'\"])(.*?)\1/, 2]
end
def files
file_collector = FileCollector.new(base_dir)
file_collector.collect
end
end
end
end
@ -692,9 +615,6 @@ install?(:ext, :comm, :gem) do
prepare "default gems", gem_dir, directories
spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
default_spec_dir = "#{spec_dir}/default"
makedirs(default_spec_dir)
gems = {}
File.foreach(File.join(srcdir, "defs/default_gems")) do |line|
line.chomp!
@ -704,12 +624,11 @@ install?(:ext, :comm, :gem) do
line.scan(/\G\s*([^\[\]\s]+|\[([^\[\]]*)\])/) do
words << ($2 ? $2.split : $1)
end
name, base_dir, src, execs = *words
next unless name and base_dir and src
name, src, execs = *words
next unless name and src
src = File.join(srcdir, src)
base_dir = File.join(srcdir, base_dir)
specgen = RbInstall::Specs::Generator.new(name, base_dir, src, execs || [])
specgen = RbInstall::Specs::Generator.new(name, src, execs || [])
gems[name] ||= specgen
end
@ -720,12 +639,10 @@ install?(:ext, :comm, :gem) do
gems.sort.each do |name, specgen|
gemspec = specgen.gemspec
base_dir = specgen.src.sub(/\A#{Regexp.escape(srcdir)}\//, "")
full_name = "#{gemspec.name}-#{gemspec.version}"
puts "#{" "*30}#{gemspec.name} #{gemspec.version}"
gemspec_path = File.join(default_spec_dir, "#{full_name}.gemspec")
open_for_install(gemspec_path, $data_mode) do
open_for_install(File.join(spec_dir, "#{full_name}.gemspec"), $data_mode) do
specgen.spec_source
end