Sha256: 9a5642c36905197941047263c4ee4b4e78a08d5165b9badf7eb1bb5a2e4c4f3a

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

require_relative 'command'
require_relative '../examiner'

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

      private

      def reporter
        @reporter ||= @options.reporter
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reek-3.2.1 lib/reek/cli/reek_command.rb
reek-3.1 lib/reek/cli/reek_command.rb