Sha256: 50d112c2e7d09dcbbf7686009e14327f62026cbf087e02db48887d9ae3e676a4

Contents?: true

Size: 746 Bytes

Versions: 3

Compression:

Stored size: 746 Bytes

Contents

require 'reek/cli/command'
require 'reek/examiner'

module Reek
  module Cli
    #
    # A command to collect smells from a set of sources and write them out in
    # text report format.
    #
    class ReekCommand < Command
      def execute(app)
        @parser.sources.each do |source|
          reporter.add_examiner(Examiner.new(source, config_files, smell_names))
        end
        reporter.smells? ? app.report_smells : app.report_success
        reporter.show
      end

      private

      def reporter
        @reporter ||= @parser.reporter
      end

      def smell_names
        @smell_names ||= @parser.smells_to_detect
      end

      def config_files
        @config_files ||= @parser.config_files
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-1.5.1 lib/reek/cli/reek_command.rb
reek-1.5.0 lib/reek/cli/reek_command.rb
reek-1.4.0 lib/reek/cli/reek_command.rb