Sha256: 880ce4790b5da41fef52d9709d859becd2e01900a3716308f9c47ebd139be56d

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

module Rubycritic

  class SmellsAggregator
    def initialize(smell_adapters)
      @smell_adapters = smell_adapters
    end

    def smells
      @smells ||= @smell_adapters.map(&:smells).flatten.sort
    end

    def smelly_pathnames
      @smelly_pathnames ||= pathnames_to_files_with_smells
    end

    private

    def pathnames_to_files_with_smells
      pathnames = Hash.new { |hash, key| hash[key] = [] }
      smells.each do |smell|
        smell.pathnames.each do |path|
          pathnames[path] << smell
        end
      end
      pathnames
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-0.0.7 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.6 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.5 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.4 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.3 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.2 lib/rubycritic/smells_aggregator.rb
rubycritic-0.0.1 lib/rubycritic/smells_aggregator.rb