lib/rubocop/config_obsoletion.rb in rubocop-1.32.0 vs lib/rubocop/config_obsoletion.rb in rubocop-1.33.0
- old
+ new
@@ -45,13 +45,18 @@
private
# Default rules for obsoletions are in config/obsoletion.yml
# Additional rules files can be added with `RuboCop::ConfigObsoletion.files << filename`
- def load_rules
+ def load_rules # rubocop:disable Metrics/AbcSize
rules = self.class.files.each_with_object({}) do |filename, hash|
hash.merge!(YAML.safe_load(File.read(filename))) do |_key, first, second|
- first.merge(second)
+ case first
+ when Hash
+ first.merge(second)
+ when Array
+ first.concat(second)
+ end
end
end
cop_rules = rules.slice(*COP_RULE_CLASSES.keys)
parameter_rules = rules.slice(*PARAMETER_RULE_CLASSES.keys)