Sha256: 852766d10ed9e05b7bc40123610f6c29f4015dfad38b2a06ba8e46fb0bda3f93

Contents?: true

Size: 529 Bytes

Versions: 72

Compression:

Stored size: 529 Bytes

Contents

require 'gherkin'
require 'gherkin/tools/files'
require 'gherkin/tools/stats_listener'

module Gherkin
  module Tools
    class Stats < Files
      def run
        listener = StatsListener.new
        each do |f|
          parser = Gherkin::Parser.new(listener, true)
          lexer = Gherkin::I18nLexer.new(parser)
          lexer.scan(IO.read(f))
        end
        puts "Features:  #{listener.features}"
        puts "Scenarios: #{listener.scenarios}"
        puts "Steps:     #{listener.steps}"
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
gherkin-1.0.19 lib/gherkin/tools/stats.rb
gherkin-1.0.19-i386-mswin32 lib/gherkin/tools/stats.rb
gherkin-1.0.19-i386-mingw32 lib/gherkin/tools/stats.rb
gherkin-1.0.19-java lib/gherkin/tools/stats.rb
gherkin-1.0.18 lib/gherkin/tools/stats.rb
gherkin-1.0.18-i386-mswin32 lib/gherkin/tools/stats.rb
gherkin-1.0.18-i386-mingw32 lib/gherkin/tools/stats.rb
gherkin-1.0.18-java lib/gherkin/tools/stats.rb
gherkin-1.0.17 lib/gherkin/tools/stats.rb
gherkin-1.0.17-i386-mswin32 lib/gherkin/tools/stats.rb
gherkin-1.0.17-i386-mingw32 lib/gherkin/tools/stats.rb
gherkin-1.0.17-java lib/gherkin/tools/stats.rb
gherkin-1.0.16 lib/gherkin/tools/stats.rb
gherkin-1.0.16-i386-mswin32 lib/gherkin/tools/stats.rb
gherkin-1.0.16-i386-mingw32 lib/gherkin/tools/stats.rb
gherkin-1.0.16-java lib/gherkin/tools/stats.rb
gherkin-1.0.15 lib/gherkin/tools/stats.rb
gherkin-1.0.15-i386-mswin32 lib/gherkin/tools/stats.rb
gherkin-1.0.15-i386-mingw32 lib/gherkin/tools/stats.rb
gherkin-1.0.15-java lib/gherkin/tools/stats.rb