Sha256: 4d66c8bd71930dd9574ca344cada9c8ae1c41cfa2b35f42b396fe639fd863f08

Contents?: true

Size: 667 Bytes

Versions: 14

Compression:

Stored size: 667 Bytes

Contents

module Wally
  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

14 entries across 14 versions & 1 rubygems

Version Path
wally-0.0.47 lib/wally/counts_tags.rb
wally-0.0.46 lib/wally/counts_tags.rb
wally-0.0.45 lib/wally/counts_tags.rb
wally-0.0.44 lib/wally/counts_tags.rb
wally-0.0.43 lib/wally/counts_tags.rb
wally-0.0.42 lib/wally/counts_tags.rb
wally-0.0.41 lib/wally/counts_tags.rb
wally-0.0.40 lib/wally/counts_tags.rb
wally-0.0.39 lib/wally/counts_tags.rb
wally-0.0.38 lib/wally/counts_tags.rb
wally-0.0.37 lib/wally/counts_tags.rb
wally-0.0.36 lib/wally/counts_tags.rb
wally-0.0.35 lib/wally/counts_tags.rb
wally-0.0.34 lib/wally/counts_tags.rb