mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[rubygems/rubygems] Add 'call for update' to RubyGems install command.
05811f8248
This commit is contained in:
parent
ceeefb5870
commit
c7d043065c
Notes:
git
2022-11-11 08:24:29 +00:00
6 changed files with 243 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue