[rubygems/rubygems] Add 'call for update' to RubyGems install command.

05811f8248
This commit is contained in:
Josef Šimánek 2022-09-11 05:40:55 +02:00 committed by Hiroshi SHIBATA
parent ceeefb5870
commit c7d043065c
Notes: git 2022-11-11 08:24:29 +00:00
6 changed files with 243 additions and 0 deletions

View file

@ -371,6 +371,18 @@ if you believe they were disclosed to a third party.
@backtrace || $DEBUG
end
# Check config file is writable. Creates empty file if not present to ensure we can write to it.
def config_file_writable?
if File.exist?(config_file_name)
File.writable?(config_file_name)
else
require "fileutils"
FileUtils.mkdir_p File.dirname(config_file_name)
File.open(config_file_name, "w") {}
true
end
end
# The name of the configuration file.
def config_file_name
@config_file_name || Gem.config_file