diff options
Diffstat (limited to 'lib/rubygems/config_file.rb')
-rw-r--r-- | lib/rubygems/config_file.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 1bdc79ae06..f93917cbd4 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -321,12 +321,12 @@ if you believe they were disclosed to a third party. @rubygems_api_key = api_key end - YAMLErrors = [ArgumentError] - YAMLErrors << Psych::SyntaxError if defined?(Psych::SyntaxError) - def load_file(filename) Gem.load_yaml + yaml_errors = [ArgumentError] + yaml_errors << Psych::SyntaxError if defined?(Psych::SyntaxError) + return {} unless filename and File.exist? filename begin @@ -336,7 +336,7 @@ if you believe they were disclosed to a third party. return {} end return content - rescue *YAMLErrors => e + rescue *yaml_errors => e warn "Failed to load #{filename}, #{e}" rescue Errno::EACCES warn "Failed to load #{filename} due to permissions problem." |