From 650a65c6fc7955d1ccfca16d3876c3f6a07a015c Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Thu, 15 Jul 2021 20:25:12 +0900 Subject: [PATCH] [rubygems/rubygems] Add missing `require 'fileutils'` in `Gem::ConfigFile` https://github.com/rubygems/rubygems/commit/c4004fadd9 --- lib/rubygems/config_file.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 3746d7aab0..02bb2be122 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -320,7 +320,8 @@ if you believe they were disclosed to a third party. config = load_file(credentials_path).merge(host => api_key) dirname = File.dirname credentials_path - FileUtils.mkdir_p(dirname) unless File.exist? dirname + require 'fileutils' + FileUtils.mkdir_p(dirname) Gem.load_yaml @@ -457,9 +458,8 @@ if you believe they were disclosed to a third party. # Writes out this config file, replacing its source. def write - unless File.exist?(File.dirname(config_file_name)) - FileUtils.mkdir_p File.dirname(config_file_name) - end + require 'fileutils' + FileUtils.mkdir_p File.dirname(config_file_name) File.open config_file_name, 'w' do |io| io.write to_yaml