Sha256: 7f5d8c6e58c2134c841b452e05568132dcc610f19cc30a7bc494a40927c64127

Contents?: true

Size: 691 Bytes

Versions: 15

Compression:

Stored size: 691 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, 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

15 entries across 15 versions & 1 rubygems

Version Path
reek-3.10.1 lib/reek/cli/reek_command.rb
reek-3.10.0 lib/reek/cli/reek_command.rb
reek-3.9.1 lib/reek/cli/reek_command.rb
reek-3.9.0 lib/reek/cli/reek_command.rb
reek-3.8.3 lib/reek/cli/reek_command.rb
reek-3.8.2 lib/reek/cli/reek_command.rb
reek-3.8.1 lib/reek/cli/reek_command.rb
reek-3.8.0 lib/reek/cli/reek_command.rb
reek-3.7.1 lib/reek/cli/reek_command.rb
reek-3.7.0 lib/reek/cli/reek_command.rb
reek-3.6.1 lib/reek/cli/reek_command.rb
reek-3.6.0 lib/reek/cli/reek_command.rb
reek-3.5.0 lib/reek/cli/reek_command.rb
reek-3.4.1 lib/reek/cli/reek_command.rb
reek-3.4.0 lib/reek/cli/reek_command.rb