mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
rbinstall.rb: Note about no_write
[ci skip]
Since RubyGems 3.0.0 `dir_mode` option is supported, but using `File` method to apply it, not `FileUtils`. To reduce overwriting existing methods (especially built-in class), and to record making directories, keep using `no_write` method.
This commit is contained in:
parent
51952929e1
commit
d842554769
1 changed files with 4 additions and 0 deletions
|
@ -527,6 +527,8 @@ module RbInstall
|
|||
const_set(:FileUtils, fu::NoWrite)
|
||||
fu
|
||||
end
|
||||
# RubyGems 3.0.0 or later supports `dir_mode`, but it uses
|
||||
# `File` method to apply it, not `FileUtils`.
|
||||
dir_mode = options.delete(:dir_mode) if options
|
||||
end
|
||||
yield
|
||||
|
@ -806,6 +808,7 @@ def install_default_gem(dir, srcdir, bindir)
|
|||
install_dir = with_destdir(gem_dir)
|
||||
prepare "default gems from #{dir}", gem_dir
|
||||
RbInstall.no_write do
|
||||
# Record making directories
|
||||
makedirs(Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)})
|
||||
end
|
||||
|
||||
|
@ -1103,6 +1106,7 @@ install?(:ext, :comm, :gem, :'bundled-gems') do
|
|||
install_dir = with_destdir(gem_dir)
|
||||
prepare "bundled gems", gem_dir
|
||||
RbInstall.no_write do
|
||||
# Record making directories
|
||||
makedirs(Gem.ensure_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)})
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue