mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
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:
parent
6d6880ff40
commit
90df7a08e4
58 changed files with 633 additions and 197 deletions
|
@ -68,7 +68,7 @@ Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
|
|||
|
||||
if not File.exist?(options[:directory]) or
|
||||
not File.directory?(options[:directory]) then
|
||||
alert_error "unknown directory name #{directory}."
|
||||
alert_error "unknown directory name #{options[:directory]}."
|
||||
terminate_interaction 1
|
||||
else
|
||||
indexer = Gem::Indexer.new options.delete(:directory), options
|
||||
|
|
|
@ -64,7 +64,7 @@ permission to.
|
|||
end
|
||||
|
||||
with_response response do |resp|
|
||||
owners = YAML.load resp.body
|
||||
owners = Gem::SafeYAML.load resp.body
|
||||
|
||||
say "Owners for gem: #{name}"
|
||||
owners.each do |owner|
|
||||
|
|
|
@ -350,7 +350,9 @@ By default, this RubyGems will install gem as:
|
|||
def install_default_bundler_gem
|
||||
return unless Gem::USE_BUNDLER_FOR_GEMDEPS
|
||||
|
||||
mkdir_p Gem::Specification.default_specifications_dir
|
||||
specs_dir = Gem::Specification.default_specifications_dir
|
||||
specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform?
|
||||
mkdir_p specs_dir
|
||||
|
||||
# Workaround for non-git environment.
|
||||
gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
|
||||
|
@ -359,23 +361,36 @@ By default, this RubyGems will install gem as:
|
|||
bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
|
||||
bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] }
|
||||
bundler_spec.executables -= %w[bundler bundle_ruby]
|
||||
Dir.entries(Gem::Specification.default_specifications_dir).
|
||||
select {|gs| gs.start_with?("bundler-") }.
|
||||
each {|gs| File.delete(File.join(Gem::Specification.default_specifications_dir, gs)) }
|
||||
|
||||
default_spec_path = File.join(Gem::Specification.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
|
||||
# Remove bundler-*.gemspec in default specification directory.
|
||||
Dir.entries(specs_dir).
|
||||
select {|gs| gs.start_with?("bundler-") }.
|
||||
each {|gs| File.delete(File.join(specs_dir, gs)) }
|
||||
|
||||
default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec")
|
||||
Gem.write_binary(default_spec_path, bundler_spec.to_ruby)
|
||||
|
||||
bundler_spec = Gem::Specification.load(default_spec_path)
|
||||
|
||||
# Remove gemspec that was same version of vendored bundler.
|
||||
normal_gemspec = File.join(Gem.default_dir, "specifications", "bundler-#{bundler_spec.version}.gemspec")
|
||||
if File.file? normal_gemspec
|
||||
File.delete normal_gemspec
|
||||
end
|
||||
|
||||
# Remove gem files that were same version of vendored bundler.
|
||||
if File.directory? bundler_spec.gems_dir
|
||||
Dir.entries(bundler_spec.gems_dir).
|
||||
select {|default_gem| File.basename(default_gem).match(/^bundler-#{Gem::Version::VERSION_PATTERN}$/) }.
|
||||
select {|default_gem| File.basename(default_gem) == "bundler-#{bundler_spec.version}" }.
|
||||
each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
|
||||
end
|
||||
|
||||
mkdir_p bundler_spec.bin_dir
|
||||
bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) }
|
||||
bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir)
|
||||
bundler_bin_dir = File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform?
|
||||
mkdir_p bundler_bin_dir
|
||||
bundler_spec.executables.each do |e|
|
||||
cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
|
||||
end
|
||||
|
||||
if Gem.win_platform?
|
||||
require 'rubygems/installer'
|
||||
|
|
|
@ -94,7 +94,7 @@ command help for an example.
|
|||
|
||||
spec_file = File.basename spec.spec_file
|
||||
|
||||
open spec_file, 'w' do |io|
|
||||
File.open spec_file, 'w' do |io|
|
||||
io.write metadata
|
||||
end
|
||||
else
|
||||
|
@ -176,7 +176,7 @@ command help for an example.
|
|||
|
||||
metadata = nil
|
||||
|
||||
open path, Gem.binary_mode do |io|
|
||||
File.open path, Gem.binary_mode do |io|
|
||||
tar = Gem::Package::TarReader.new io
|
||||
tar.each_entry do |entry|
|
||||
case entry.full_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue