lib/rubocop/config_loader.rb in rubocop-0.57.2 vs lib/rubocop/config_loader.rb in rubocop-0.58.0

- old
+ new

@@ -174,18 +174,14 @@ raise ConfigNotFoundError, "Configuration file not found: #{absolute_path}" end def yaml_safe_load(yaml_code, filename) - if YAML.respond_to?(:safe_load) # Ruby 2.1+ - if defined?(SafeYAML) && SafeYAML.respond_to?(:load) - SafeYAML.load(yaml_code, filename, - whitelisted_tags: %w[!ruby/regexp]) - else - YAML.safe_load(yaml_code, [Regexp, Symbol], [], false, filename) - end + if defined?(SafeYAML) && SafeYAML.respond_to?(:load) + SafeYAML.load(yaml_code, filename, + whitelisted_tags: %w[!ruby/regexp]) else - YAML.load(yaml_code, filename) # rubocop:disable Security/YAMLLoad + YAML.safe_load(yaml_code, [Regexp, Symbol], [], false, filename) end end end # Initializing class ivars