summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 00:20:49 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 00:20:49 +0000
commitae19a18996727954cba2da90ab816e2d5023822a ()
tree158b316a17cb6618235df3ce4cf27c6108240084
parent9b9fe826fd1ce825af3503f39643f75910307a51 (diff)
Merge RubyGems 3.0.1 from rubygems/rubygems.
It fixed the issues of RubyGems 3.0.0. https://blog.rubygems.org/2018/12/23/3.0.1-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems.rb4
-rw-r--r--lib/rubygems/commands/setup_command.rb10
-rw-r--r--lib/rubygems/installer.rb10
-rw-r--r--lib/rubygems/package.rb4
-rw-r--r--lib/rubygems/package/old.rb2
-rw-r--r--lib/rubygems/util.rb2
-rw-r--r--test/rubygems/test_gem.rb2
-rw-r--r--test/rubygems/test_gem_util.rb17
8 files changed, 34 insertions, 17 deletions
@@ -9,7 +9,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.0.0".freeze
end
# Must be first since it unloads the prelude from 1.9.2
@@ -572,7 +572,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
#++
def self.find_home
- Dir.home
rescue
if Gem.win_platform?
File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/')
@@ -312,7 +312,7 @@ By default, this RubyGems will install gem as:
dest_file = File.join dest_dir, file
dest_dir = File.dirname dest_file
unless File.directory? dest_dir
- mkdir_p dest_dir, :mode => 0700
end
install file, dest_file, :mode => options[:data_mode] || 0644
@@ -387,7 +387,7 @@ By default, this RubyGems will install gem as:
specs_dir = Gem::Specification.default_specifications_dir
specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform?
- mkdir_p specs_dir, :mode => 0700
# Workaround for non-git environment.
gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
@@ -422,7 +422,7 @@ By default, this RubyGems will install gem as:
bundler_bin_dir = bundler_spec.bin_dir
bundler_bin_dir = File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform?
- mkdir_p bundler_bin_dir, :mode => 0700
bundler_spec.executables.each do |e|
cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
end
@@ -446,8 +446,8 @@ By default, this RubyGems will install gem as:
lib_dir, bin_dir = generate_default_dirs(install_destdir)
end
- mkdir_p lib_dir, :mode => 0700
- mkdir_p bin_dir, :mode => 0700
return lib_dir, bin_dir
end
@@ -309,7 +309,7 @@ class Gem::Installer
FileUtils.rm_rf spec.extension_dir
dir_mode = options[:dir_mode]
- FileUtils.mkdir_p gem_dir, :mode => dir_mode && 0700
if @options[:install_as_default]
extract_bin
@@ -481,7 +481,7 @@ class Gem::Installer
return if spec.executables.nil? or spec.executables.empty?
begin
- Dir.mkdir @bin_dir, *[options[:dir_mode] && 0700].compact
rescue SystemCallError
raise unless File.directory? @bin_dir
end
@@ -525,7 +525,7 @@ class Gem::Installer
FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
- File.open bin_script_path, 'wb', 0700 do |file|
file.print app_script_text(filename)
file.chmod(options[:prog_mode] || 0755)
end
@@ -720,7 +720,7 @@ class Gem::Installer
end
def verify_gem_home(unpack = false) # :nodoc:
- FileUtils.mkdir_p gem_home, :mode => options[:dir_mode] && 0700
raise Gem::FilePermissionError, gem_home unless
unpack or File.writable?(gem_home)
end
@@ -905,7 +905,7 @@ TEXT
build_info_dir = File.join gem_home, 'build_info'
dir_mode = options[:dir_mode]
- FileUtils.mkdir_p build_info_dir, :mode => dir_mode && 0700
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
@@ -357,7 +357,7 @@ EOM
def extract_files(destination_dir, pattern = "*")
verify unless @spec
- FileUtils.mkdir_p destination_dir, :mode => dir_mode && 0700
@gem.with_read_io do |io|
reader = Gem::Package::TarReader.new io
@@ -394,7 +394,7 @@ EOM
FileUtils.rm_rf destination
mkdir_options = {}
- mkdir_options[:mode] = dir_mode ? 0700 : (entry.header.mode if entry.directory?)
mkdir =
if entry.directory?
destination
@@ -78,7 +78,7 @@ class Gem::Package::Old < Gem::Package
FileUtils.rm_rf destination
- FileUtils.mkdir_p File.dirname(destination), :mode => dir_mode && 0700
File.open destination, 'wb', file_mode(entry['mode']) do |out|
out.write file_data
@@ -122,7 +122,7 @@ module Gem::Util
def self.glob_files_in_dir(glob, base_path)
if RUBY_VERSION >= "2.5"
- Dir.glob(glob, base: base_path).map! {|f| File.join(base_path, f) }
else
Dir.glob(File.expand_path(glob, base_path))
end
@@ -198,7 +198,7 @@ class TestGem < Gem::TestCase
end
assert_equal(expected, result)
ensure
- File.chmod(0700, *Dir.glob(@gemhome+'/gems/**/').map {|path| path.untaint})
end
def test_require_missing
@@ -58,4 +58,21 @@ class TestGemUtil < Gem::TestCase
assert_equal 4, list.find { |x| x == 4 }
end
end