Sha256: 7f5b4f3667920e0797b8003b3787138cc07e78c164cbbb36b0fe3f5bc0770096

Contents?: true

Size: 653 Bytes

Versions: 12

Compression:

Stored size: 653 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)
        @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

12 entries across 12 versions & 1 rubygems

Version Path
reek-2.0.4 lib/reek/cli/reek_command.rb
reek-2.0.3 lib/reek/cli/reek_command.rb
reek-2.0.2 lib/reek/cli/reek_command.rb
reek-2.0.1 lib/reek/cli/reek_command.rb
reek-2.0.0 lib/reek/cli/reek_command.rb
reek-1.6.6 lib/reek/cli/reek_command.rb
reek-1.6.5 lib/reek/cli/reek_command.rb
reek-1.6.4 lib/reek/cli/reek_command.rb
reek-1.6.3 lib/reek/cli/reek_command.rb
reek-1.6.2 lib/reek/cli/reek_command.rb
reek-1.6.1 lib/reek/cli/reek_command.rb
reek-1.6.0 lib/reek/cli/reek_command.rb