Skip to content

Commit

Permalink
[rubygems/rubygems] Add missing require 'fileutils' in `Gem::Config…
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored and hsbt committed Jul 16, 2021
1 parent 71d3c9b commit 650a65c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rubygems/config_file.rb
Expand Up @@ -320,7 +320,8 @@ def set_api_key(host, api_key)
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

Expand Down Expand Up @@ -457,9 +458,8 @@ def to_yaml # :nodoc:

# 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
Expand Down

0 comments on commit 650a65c

Please sign in to comment.