summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-24 04:13:11 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-24 04:13:11 +0000
commitbddf4b0237f9598df782effc5484120d3786c2f9 (patch)
treecf6a5d0173e94c9749867e100a2a5cb0f7808746
parenteff68733639edcfbff9f090cc2dd11cf07ae90a4 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/commands/update_command.rb2
-rw-r--r--lib/rubygems/config_file.rb2
-rw-r--r--lib/rubygems/defaults.rb18
-rw-r--r--test/rubygems/test_gem.rb7
-rw-r--r--test/rubygems/test_gem_installer.rb103
7 files changed, 107 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 530bc6739c..fac4fad4e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jun 24 13:12:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* common.mk (lib/unicode_normalize/tables.rb): should not depend
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index b041dd1042..ce9dc6a66a 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -10,7 +10,7 @@ require 'rbconfig'
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
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 688e9b0e6c..f3d70a92a6 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -241,7 +241,7 @@ command to remove old versions.
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
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index c8014814b4..3a5e7718df 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -54,7 +54,7 @@ class Gem::ConfigFile
# For Ruby implementers to set configuration defaults. Set in
# rubygems/defaults/#{RUBY_ENGINE}.rb
- PLATFORM_DEFAULTS = {}
+ PLATFORM_DEFAULTS = Gem.platform_defaults
# :stopdoc:
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index 16fa96eb2d..43d57fc808 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -175,4 +175,22 @@ module Gem
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
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 81b2c01519..90695b56d7 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1695,6 +1695,13 @@ You may need to `gem install -g` to install missing gems
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
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index ca48065bd4..2d747bed72 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -1141,47 +1141,88 @@ gem 'other', version
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"
+ # 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
- CONFIG['CC'] = '$(TOUCH) $@ ||'
- CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
- $ruby = '#{Gem.ruby}'
+ write_file File.join(@tempdir, "a.c") do |io|
+ io.write <<-C
+ #include <ruby.h>
+ void Init_a() { }
+ C
+ end
- create_makefile("#{@spec.name}")
- RUBY
- end
+ Dir.mkdir File.join(@tempdir, "lib")
+ write_file File.join(@tempdir, 'lib', "b.rb") do |io|
+ io.write "# b.rb"
+ end
- write_file File.join(@tempdir, "depend")
+ @spec.files += %w[extconf.rb lib/b.rb a.c]
- write_file File.join(@tempdir, "a.c") do |io|
- io.write <<-C
- #include <ruby.h>
- void Init_a() { }
- C
- end
+ use_ui @ui do
+ path = Gem::Package.build @spec
+
+ installer = Gem::Installer.at path
+ installer.install
+ end
- Dir.mkdir File.join(@tempdir, "lib")
- write_file File.join(@tempdir, 'lib', "b.rb") do |io|
- io.write "# b.rb"
+ 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
+ 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"
- @spec.files += %w[extconf.rb lib/b.rb depend a.c]
+ CONFIG['CC'] = '$(TOUCH) $@ ||'
+ CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
+ $ruby = '#{Gem.ruby}'
- use_ui @ui do
- path = Gem::Package.build @spec
+ create_makefile("#{@spec.name}")
+ RUBY
+ end
- installer = Gem::Installer.at path
- installer.install
- 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
- 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
+ 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
end
def test_install_extension_and_script