ruby-changes:66815
From: Masafumi <ko1@a...>
Date: Fri, 16 Jul 2021 15:40:28 +0900 (JST)
Subject: [ruby-changes:66815] 650a65c6fc (master): [rubygems/rubygems] Add missing `require 'fileutils'` in `Gem::ConfigFile`
https://git.ruby-lang.org/ruby.git/commit/?id=650a65c6fc From 650a65c6fc7955d1ccfca16d3876c3f6a07a015c Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@u...> Date: Thu, 15 Jul 2021 20:25:12 +0900 Subject: [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 3746d7a..02bb2be 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. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/config_file.rb#L320 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. https://github.com/ruby/ruby/blob/trunk/lib/rubygems/config_file.rb#L458 # 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 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/