Sha256: 8bdc687ce164888628e96288849df194c09b225d5bb3be4a0a669fd452df0a98

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

require "rubycritic/active_support/methods"
require "rubycritic/smell_adapters/flay"
require "rubycritic/smell_adapters/flog"
require "rubycritic/smell_adapters/reek"

module Rubycritic

  class AnalysersRunner
    include ActiveSupport

    ANALYSERS = ["Flay", "Flog", "Reek"]

    def initialize(paths)
      @paths = paths
    end

    def run
      aggregate_smells(smell_adapters)
    end

    private

    def smell_adapters
      ANALYSERS.map do |analyser_name|
        constantize("Rubycritic::SmellAdapter::#{analyser_name}").new(@paths)
      end
    end

    def aggregate_smells(smell_adapters)
      smell_adapters.map(&:smells).flatten.sort
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-0.0.11 lib/rubycritic/analysers_runner.rb