lib/reek/configuration/configuration_file_finder.rb in reek-4.7.2 vs lib/reek/configuration/configuration_file_finder.rb in reek-4.7.3

- old
+ new

@@ -16,20 +16,20 @@ # 3. Having a file ending with .reek in your HOME directory # # The order in which ConfigurationFileFinder tries to find such a # configuration file is exactly like above. module ConfigurationFileFinder - TOO_MANY_CONFIGURATION_FILES_MESSAGE = <<-EOS.freeze + TOO_MANY_CONFIGURATION_FILES_MESSAGE = <<-MESSAGE.freeze Error: Found multiple configuration files %s while scanning directory %s. Reek supports only one configuration file. You have 2 options now: 1) Remove all offending files. 2) Be specific about which one you want to load via the -c switch. - EOS + MESSAGE class << self # # Finds and loads a configuration file from a given path. # @@ -62,10 +62,10 @@ # :reek:TooManyStatements: { max_statements: 6 } def load_from_file(path) return {} unless path begin configuration = YAML.load_file(path) || {} - rescue => error + rescue StandardError => error raise ConfigFileException, "Invalid configuration file #{path}, error is #{error}" end unless configuration.is_a? Hash raise ConfigFileException, "Invalid configuration file \"#{path}\" -- Not a hash"