lib/quality/runner.rb in quality-4.0.2 vs lib/quality/runner.rb in quality-5.0.0

- old
+ new

@@ -2,32 +2,38 @@ require_relative 'tools/flay' require_relative 'tools/flog' require_relative 'tools/reek' require_relative 'tools/rubocop' require_relative 'tools/bigfiles' +require_relative 'tools/punchlist' +# XXX: This name is too similar to process_runner + module Quality # Knows how to run different quality tools based on a configuration # already determined. class Runner include Tools::Cane include Tools::Flay include Tools::Flog include Tools::Reek include Tools::Rubocop include Tools::BigFiles + include Tools::Punchlist def initialize(config, gem_spec: Gem::Specification, quality_checker_class: Quality::QualityChecker, count_io: IO, - count_file: File) + count_file: File, + globber: Dir) @config = config @gem_spec = gem_spec @quality_checker_class = quality_checker_class @count_io = count_io @count_file = count_file + @globber = globber end def run_quality tools.each { |tool| run_quality_with_tool(tool) } end @@ -41,15 +47,13 @@ elsif !installed puts "#{tool} not installed" end end - def globber - @config.globber - end - def run_ratchet - globber.glob("#{@config.output_dir}/*_high_water_mark").each do |filename| + # XXX: a lot of things know about globbing--isn't this config's job? + @globber.glob("#{@config.output_dir}/*_high_water_mark") + .each do |filename| run_ratchet_on_file(filename) end end def run_ratchet_on_file(filename)