lib/quality/runner.rb in quality-21.0.4 vs lib/quality/runner.rb in quality-21.0.5

- old
+ new

@@ -32,22 +32,24 @@ @globber = globber @which = which end def run_quality - tools.each { |tool| run_quality_with_tool(tool) } + tools.each do |tool_name, tool_exe| + run_quality_with_tool(tool_name, tool_exe) + end end - def run_quality_with_tool(tool) - suppressed = @config.skip_tools.include? tool - installed = @gem_spec.find_all_by_name(tool).any? || - !@which.which(tool).nil? + def run_quality_with_tool(tool_name, tool_exe) + suppressed = @config.skip_tools.include? tool_name + installed = @gem_spec.find_all_by_name(tool_name).any? || + !@which.which(tool_exe).nil? if installed && !suppressed - method("quality_#{tool}".to_sym).call + method("quality_#{tool_name}".to_sym).call elsif !installed - puts "#{tool} not installed" + puts "#{tool_name} not installed" end end def run_ratchet @config.all_output_files.each { |filename| run_ratchet_on_file(filename) } @@ -74,14 +76,16 @@ def tools self.class.ancestors.map do |ancestor| ancestor_name = ancestor.to_s next unless ancestor_name.start_with?('Quality::Tools::') - # if ancestor.respond_to? :command_name - # ancestor.command_name - # else - ancestor_name.split('::').last.underscore - # end + name = ancestor.to_s.split('::').last.underscore + command_name = if ancestor.respond_to? :command_name + ancestor.command_name + else + name + end + [name, command_name] end.compact end def ratchet_quality_cmd(cmd, command_options,