ruby-changes:43421
From: hsbt <ko1@a...>
Date: Fri, 24 Jun 2016 13:13:16 +0900 (JST)
Subject: [ruby-changes:43421] hsbt:r55495 (trunk): * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*:
hsbt 2016-06-24 13:13:11 +0900 (Fri, 24 Jun 2016) New Revision: 55495 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55495 Log: * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems 2.6.5 and 2.6.6. Release note of 2.6.5: https://github.com/rubygems/rubygems/commit/656f5d94dc888d78d0d00f3598a4fa37391aac80 Release note of 2.6.6: https://github.com/rubygems/rubygems/commit/ccb9c3300c063f5b5656669972d24a10ef8afbf5 Modified files: trunk/ChangeLog trunk/lib/rubygems/commands/update_command.rb trunk/lib/rubygems/config_file.rb trunk/lib/rubygems/defaults.rb trunk/lib/rubygems.rb trunk/test/rubygems/test_gem.rb trunk/test/rubygems/test_gem_installer.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 55494) +++ ChangeLog (revision 55495) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jun 24 13:12:41 2016 Nobuyoshi Nakada <nobu@r...> + + * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: + Update rubygems 2.6.5 and 2.6.6. + Release note of 2.6.5: https://github.com/rubygems/rubygems/commit/656f5d94dc888d78d0d00f3598a4fa37391aac80 + Release note of 2.6.6: https://github.com/rubygems/rubygems/commit/ccb9c3300c063f5b5656669972d24a10ef8afbf5 + Fri Jun 24 09:17:15 2016 Nobuyoshi Nakada <nobu@r...> * common.mk (lib/unicode_normalize/tables.rb): should not depend Index: lib/rubygems.rb =================================================================== --- lib/rubygems.rb (revision 55494) +++ lib/rubygems.rb (revision 55495) @@ -10,7 +10,7 @@ require 'rbconfig' https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L10 require 'thread' module Gem - VERSION = '2.6.4' + VERSION = '2.6.6' end # Must be first since it unloads the prelude from 1.9.2 Index: lib/rubygems/config_file.rb =================================================================== --- lib/rubygems/config_file.rb (revision 55494) +++ lib/rubygems/config_file.rb (revision 55495) @@ -54,7 +54,7 @@ class Gem::ConfigFile https://github.com/ruby/ruby/blob/trunk/lib/rubygems/config_file.rb#L54 # For Ruby implementers to set configuration defaults. Set in # rubygems/defaults/#{RUBY_ENGINE}.rb - PLATFORM_DEFAULTS = {} + PLATFORM_DEFAULTS = Gem.platform_defaults # :stopdoc: Index: lib/rubygems/commands/update_command.rb =================================================================== --- lib/rubygems/commands/update_command.rb (revision 55494) +++ lib/rubygems/commands/update_command.rb (revision 55495) @@ -241,7 +241,7 @@ command to remove old versions. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/update_command.rb#L241 update_gem 'rubygems-update', version installed_gems = Gem::Specification.find_all_by_name 'rubygems-update', requirement - version = installed_gems.last.version + version = installed_gems.first.version install_rubygems version end Index: lib/rubygems/defaults.rb =================================================================== --- lib/rubygems/defaults.rb (revision 55494) +++ lib/rubygems/defaults.rb (revision 55495) @@ -175,4 +175,22 @@ module Gem https://github.com/ruby/ruby/blob/trunk/lib/rubygems/defaults.rb#L175 RbConfig::CONFIG['ruby_version'] end + ## + # Default options for gem commands. + # + # The options here should be structured as an array of string "gem" + # command names as keys and a string of the default options as values. + # + # Example: + # + # def self.platform_defaults + # { + # 'install' => '--no-rdoc --no-ri --env-shebang', + # 'update' => '--no-rdoc --no-ri --env-shebang' + # } + # end + + def self.platform_defaults + {} + end end Index: test/rubygems/test_gem.rb =================================================================== --- test/rubygems/test_gem.rb (revision 55494) +++ test/rubygems/test_gem.rb (revision 55495) @@ -1695,6 +1695,13 @@ You may need to `gem install -g` to inst https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1695 ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end + def test_platform_defaults + platform_defaults = Gem.platform_defaults + + assert platform_defaults != nil + assert platform_defaults.is_a? Hash + end + def ruby_install_name name orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name'] RbConfig::CONFIG['ruby_install_name'] = name Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 55494) +++ test/rubygems/test_gem_installer.rb (revision 55495) @@ -1141,47 +1141,88 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1141 refute_path_exists should_be_removed end - def test_find_lib_file_after_install - @spec.extensions << "extconf.rb" - write_file File.join(@tempdir, "extconf.rb") do |io| - io.write <<-RUBY - require "mkmf" - - CONFIG['CC'] = '$(TOUCH) $@ ||' - CONFIG['LDSHARED'] = '$(TOUCH) $@ ||' - $ruby = '#{Gem.ruby}' - - create_makefile("#{@spec.name}") - RUBY - end - - write_file File.join(@tempdir, "depend") - - write_file File.join(@tempdir, "a.c") do |io| - io.write <<-C - #include <ruby.h> - void Init_a() { } - C - end - - Dir.mkdir File.join(@tempdir, "lib") - write_file File.join(@tempdir, 'lib', "b.rb") do |io| - io.write "# b.rb" + # ruby core repository needs to `depend` file for extension build. + # but 1.9.2 and earlier mkmf.rb does not create TOUCH file like depend. + if RUBY_VERSION < '1.9.3' + def test_find_lib_file_after_install + + @spec.extensions << "extconf.rb" + write_file File.join(@tempdir, "extconf.rb") do |io| + io.write <<-RUBY + require "mkmf" + create_makefile("#{@spec.name}") + RUBY + end + + write_file File.join(@tempdir, "a.c") do |io| + io.write <<-C + #include <ruby.h> + void Init_a() { } + C + end + + Dir.mkdir File.join(@tempdir, "lib") + write_file File.join(@tempdir, 'lib', "b.rb") do |io| + io.write "# b.rb" + end + + @spec.files += %w[extconf.rb lib/b.rb a.c] + + use_ui @ui do + path = Gem::Package.build @spec + + installer = Gem::Installer.at path + installer.install + end + + expected = File.join @spec.full_require_paths.find { |path| + File.exist? File.join path, 'b.rb' + }, 'b.rb' + assert_equal expected, @spec.matches_for_glob('b.rb').first end - - @spec.files += %w[extconf.rb lib/b.rb depend a.c] - - use_ui @ui do - path = Gem::Package.build @spec - - installer = Gem::Installer.at path - installer.install + else + def test_find_lib_file_after_install + @spec.extensions << "extconf.rb" + write_file File.join(@tempdir, "extconf.rb") do |io| + io.write <<-RUBY + require "mkmf" + + CONFIG['CC'] = '$(TOUCH) $@ ||' + CONFIG['LDSHARED'] = '$(TOUCH) $@ ||' + $ruby = '#{Gem.ruby}' + + create_makefile("#{@spec.name}") + RUBY + end + + write_file File.join(@tempdir, "depend") + + write_file File.join(@tempdir, "a.c") do |io| + io.write <<-C + #include <ruby.h> + void Init_a() { } + C + end + + Dir.mkdir File.join(@tempdir, "lib") + write_file File.join(@tempdir, 'lib', "b.rb") do |io| + io.write "# b.rb" + end + + @spec.files += %w[extconf.rb lib/b.rb depend a.c] + + use_ui @ui do + path = Gem::Package.build @spec + + installer = Gem::Installer.at path + installer.install + end + + expected = File.join @spec.full_require_paths.find { |path| + File.exist? File.join path, 'b.rb' + }, 'b.rb' + assert_equal expected, @spec.matches_for_glob('b.rb').first end - - expected = File.join @spec.full_require_paths.find { |path| - File.exist? File.join path, 'b.rb' - }, 'b.rb' - assert_equal expected, @spec.matches_for_glob('b.rb').first end def test_install_extension_and_script -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/