Sha256: b230941e42c85fb11b86a36f27c317d3d26a2ede14b01389bd02696e92a693b3

Contents?: true

Size: 690 Bytes

Versions: 5

Compression:

Stored size: 690 Bytes

Contents

require 'reek/examiner'

module Reek
  module Cli

    #
    # A command to collect smells from a set of sources and write them out in
    # YAML format.
    #
    class YamlCommand
      def self.create(sources, config_files)
        examiners = sources.map {|src| Examiner.new(src, config_files) }
        new(examiners)
      end

      def initialize(examiners)
        @examiners = examiners
      end

      def execute(view)
        smells = []
        @examiners.each {|examiner| smells += examiner.smells}
        if smells.empty?
          view.report_success
        else
          view.output(smells.to_yaml)
          view.report_smells
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-1.3.6 lib/reek/cli/yaml_command.rb
reek-1.3.5 lib/reek/cli/yaml_command.rb
reek-1.3.4 lib/reek/cli/yaml_command.rb
reek-1.3.3 lib/reek/cli/yaml_command.rb
reek-1.3.2 lib/reek/cli/yaml_command.rb