lib/reek/cli/reek_command.rb in reek-1.2.7.1 vs lib/reek/cli/reek_command.rb in reek-1.2.7.2
- old
+ new
@@ -6,24 +6,23 @@
#
# A command to collect smells from a set of sources and write them out in
# text report format.
#
class ReekCommand
- def self.create(sources, report_class, show_all)
- examiners = sources.map {|src| Examiner.new(src) }
- new(examiners, report_class, show_all)
+ def self.create(sources, report_class, strategy = ActiveSmellsOnly)
+ examiners = sources.map { |src| Examiner.new(src, strategy.new) }
+ new(examiners, report_class)
end
- def initialize(examiners, report_class, show_all)
+ def initialize(examiners, report_class)
@examiners = examiners
@report_class = report_class
- @show_all = show_all #SMELL: boolean parameter
end
def execute(view)
had_smells = false
@examiners.each do |examiner|
- rpt = @report_class.new(examiner, @show_all)
+ rpt = @report_class.new(examiner)
had_smells ||= examiner.smelly?
view.output(rpt.report)
end
if had_smells
view.report_smells