merge revision(s) 62244,62246,62301,62302,62303,62422,62436,62452: [Backport #14481]

Merge RubyGems-2.7.5 from upstream.

	  Please see its details: http://blog.rubygems.org/2018/02/06/2.7.5-released.html

	test_gem_util.rb: fix broken test

	* test/rubygems/test_gem_util.rb: no guarantee that tmpdir is
	  always underneath the root directory at all.

	test_gem_commands_setup_command.rb: BUNDLER_VERS

	* test/rubygems/test_gem_commands_setup_command.rb: run bundled
	  gem command, instead of installed one.

	no need to set bundled bundler unless Gem::USE_BUNDLER_FOR_GEMDEPS


	revert r62302 and force to define the version constant


	Merge RubyGems 2.7.6 from upstream.

	  It fixed some security vulnerabilities.

	  http://blog.rubygems.org/2018/02/15/2.7.6-released.html

	fix regexp literal warning.

	test/rubygems/test_gem_server.rb: eliminate duplicated character class warning.
	[Bug #14481]

	Remove unnecessary `[]`s

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-03-19 08:27:04 +00:00
parent 6d6880ff40
commit 90df7a08e4
58 changed files with 633 additions and 197 deletions

View file

@ -206,7 +206,7 @@ class Gem::Installer
ruby_executable = false
existing = nil
open generated_bin, 'rb' do |io|
File.open generated_bin, 'rb' do |io|
next unless io.gets =~ /^#!/ # shebang
io.gets # blankline
@ -427,7 +427,7 @@ class Gem::Installer
# specifications directory.
def write_spec
open spec_file, 'w' do |file|
File.open spec_file, 'w' do |file|
spec.installed_by_version = Gem.rubygems_version
file.puts spec.to_ruby_for_cache
@ -464,7 +464,12 @@ class Gem::Installer
def generate_bin # :nodoc:
return if spec.executables.nil? or spec.executables.empty?
Dir.mkdir @bin_dir unless File.exist? @bin_dir
begin
Dir.mkdir @bin_dir
rescue SystemCallError
raise unless File.directory? @bin_dir
end
raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir
spec.executables.each do |filename|
@ -863,7 +868,7 @@ TEXT
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
open build_info_file, 'w' do |io|
File.open build_info_file, 'w' do |io|
@build_args.each do |arg|
io.puts arg
end