A file called <something>.reek containing configuration settings for any or all of the smell detectors.
Configure the given sniffer using the contents of the config file.
# File lib/reek/source/config_file.rb, line 24 def configure(sniffer) @hash.each do |klass_name, config| klass = find_class(klass_name) sniffer.configure(klass, config) if klass end end
Find the class with this name if it exsits. If not, report the problem and return nil.
# File lib/reek/source/config_file.rb, line 35 def find_class(name) begin klass = Reek::Smells.const_get(name) rescue klass = nil end problem("\"#{name}\" is not a code smell") unless klass klass end
Load the file path with which this was initialized, unless it is already known to be a bad configuration file. If it won’t load, then it is considered a bad file.
# File lib/reek/source/config_file.rb, line 50 def load unless @@bad_config_files.include?(@file_path) begin return YAML.load_file(@file_path) || {} rescue Exception => err @@bad_config_files << @file_path problem(err.to_s) end end return {} end
Generated with the Darkfish Rdoc Generator 2.