Sha256: 286fa8d2d12bd868e68c3caa88951afbd7ec3f6de7c40b36a9f7958869389801

Contents?: true

Size: 690 Bytes

Versions: 4

Compression:

Stored size: 690 Bytes

Contents

module Wally
  class CountsTags
    def initialize lists_features
      @lists_features = lists_features
    end

    def count_tags
      @lists_features.all.inject(Hash.new(0)) do |tag_count, feature|
        if feature.gherkin["tags"]
          feature.gherkin["tags"].each do |tag|
            tag_count[tag["name"].downcase] += 1
          end
        end
        if feature.gherkin["elements"]
          feature.gherkin["elements"].each do |element|
            if element["tags"]
              element["tags"].each do |tag|
                tag_count[tag["name"].downcase] += 1
              end
            end
          end
        end
        tag_count
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wally-0.0.33 lib/wally/counts_tags.rb
wally-0.0.32 lib/wally/counts_tags.rb
wally-0.0.31 lib/wally/counts_tags.rb
wally-0.0.30 lib/wally/counts_tags.rb