Sha256: be6fb63ef089344988830131b4629f9ecf1d2b7cb6a299ad944ddb00251a2e15

Contents?: true

Size: 907 Bytes

Versions: 6

Compression:

Stored size: 907 Bytes

Contents

#!/usr/bin/env ruby
$VERBOSE=nil # Shut up JRuby warnings on Travis
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib"))
require 'optparse'
require 'json'
require 'gherkin/stream/source_events'
require 'gherkin/stream/gherkin_events'

options = {
  print_source: true,
  print_ast: true,
  print_pickles: true
}

OptionParser.new do |opts|
  opts.on("--[no-]source", "Don't print source events") do |v|
    options[:print_source] = v
  end
  opts.on("--[no-]ast", "Don't print ast events") do |v|
    options[:print_ast] = v
  end
  opts.on("--[no-]pickles", "Don't print pickle events") do |v|
    options[:print_pickles] = v
  end
end.parse!

source_events = Gherkin::Stream::SourceEvents.new(ARGV)
gherkin_events = Gherkin::Stream::GherkinEvents.new(options)

source_events.enum.each do |source_event|
  gherkin_events.enum(source_event).each do |event|
    puts JSON.generate(event)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gherkin-5.1.0 bin/gherkin
gherkin-5.0.0 bin/gherkin
gherkin-4.1.3 bin/gherkin
gherkin-4.1.2 bin/gherkin
gherkin-4.1.1 bin/gherkin
gherkin-4.1.0 bin/gherkin