Sha256: 337c2b89fd06c41f586df265518c446d83457b4f6fa0c797ee5181c762e621f4

Contents?: true

Size: 660 Bytes

Versions: 1

Compression:

Stored size: 660 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.
    #
    class ReekCommand < Command
      def execute(app)
        @options.sources.each do |source|
          reporter.add_examiner Examiner.new(source, smell_names)
        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

1 entries across 1 versions & 1 rubygems

Version Path
reek-2.1.0 lib/reek/cli/reek_command.rb