Sha256: 9dfda0e3119a68d38164e9df403df542963ae18751263c3468909ca6123a98ac

Contents?: true

Size: 752 Bytes

Versions: 8

Compression:

Stored size: 752 Bytes

Contents

require File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), '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

8 entries across 8 versions & 1 rubygems

Version Path
reek-1.3.1 lib/reek/cli/yaml_command.rb
reek-1.3 lib/reek/cli/yaml_command.rb
reek-1.2.13 lib/reek/cli/yaml_command.rb
reek-1.2.12 lib/reek/cli/yaml_command.rb
reek-1.2.11 lib/reek/cli/yaml_command.rb
reek-1.2.10 lib/reek/cli/yaml_command.rb
reek-1.2.9 lib/reek/cli/yaml_command.rb
reek-1.2.8 lib/reek/cli/yaml_command.rb