lib/reek/smells/smell_detector.rb in reek-1.2.2 vs lib/reek/smells/smell_detector.rb in reek-1.2.3
- old
+ new
@@ -8,10 +8,19 @@
end
module Reek
module Smells
+ module ExcludeInitialize
+ def self.default_config
+ super.adopt(EXCLUDE_KEY => ['initialize'])
+ end
+ def initialize(config = self.class.default_config)
+ super
+ end
+ end
+
class SmellDetector
# The name of the config field that lists the names of code contexts
# that should not be checked. Add this field to the config for each
# smell that should ignore this code element.
@@ -68,14 +77,14 @@
return unless my_part
configure_with(my_part)
end
def configure_with(config)
- @config.hash.adopt!(config)
+ @config.adopt!(config)
end
def copy
- self.class.new(@config.hash.deep_copy)
+ self.class.new(@config.deep_copy)
end
def supersede_with(config)
clone = self.copy
@masked = true