Sha256: 8a2caaf089d5b068efe807025c3502f736d29fb44987002d2642feaeffabc6a4

Contents?: true

Size: 668 Bytes

Versions: 2

Compression:

Stored size: 668 Bytes

Contents

module Nuker 
  class CountsTags
    def initialize project
      @project = project
    end

    def count_tags
      @project.features.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

2 entries across 2 versions & 1 rubygems

Version Path
nuker-2.0.0 lib/nuker/counts_tags.rb
nuker-1.0.0 lib/nuker/counts_tags.rb