1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Return early if filename is empty

https://github.com/rubygems/rubygems/commit/1b9ab33083
This commit is contained in:
bronzdoc 2019-05-31 15:37:12 -06:00 committed by Hiroshi SHIBATA
parent d74ea2eeb2
commit 673ef894ac
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 2 additions and 2 deletions

View file

@ -334,7 +334,7 @@ if you believe they were disclosed to a third party.
yaml_errors = [ArgumentError]
yaml_errors << Psych::SyntaxError if defined?(Psych::SyntaxError)
return {} unless filename and File.exist? filename
return {} unless filename && !filename.empty? && File.exist?(filename)
begin
content = Gem::SafeYAML.load(File.read(filename))

View file

@ -19,7 +19,7 @@ class TestGemConfigFile < Gem::TestCase
Gem::ConfigFile::PLATFORM_DEFAULTS.clear
@env_gemrc = ENV['GEMRC']
ENV['GEMRC'] = nil
ENV['GEMRC'] = ''
util_config_file
end