Sha256: bf30f6ff3b40b285904bfbe379f585c29fda3f67e2d3678886a30a177a223986

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

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 'cucumber/messages'
require 'gherkin'

options = {
  include_source: true,
  include_gherkin_document: true,
  include_pickles: true,
  predictable_ids: false
}

OptionParser.new do |opts|
  opts.on("--[no-]source", "Don't print source messages") do |v|
    options[:include_source] = v
  end
  opts.on("--[no-]ast", "Don't print ast messages") do |v|
    options[:include_gherkin_document] = v
  end
  opts.on("--[no-]pickles", "Don't print pickle messages") do |v|
    options[:include_pickles] = v
  end
  opts.on("--predictable-ids", "Generate incrementing ids rather than UUIDs") do |v|
    options[:id_generator] = Cucumber::Messages::IdGenerator::Incrementing.new if v
  end
end.parse!

def process_messages(messages, options)
  messages.each do |message|
    STDOUT.write(message.to_json)
    STDOUT.write("\n")
  end
end

if ARGV.empty?
  # Read from STDIN
  messages = Cucumber::Messages::NdjsonToMessageEnumerator.new(STDIN)
else
  messages = Gherkin.from_paths(ARGV, options)
end

process_messages(messages, options)

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
cucumber-gherkin-28.0.0 bin/gherkin
cucumber-gherkin-27.0.0 bin/gherkin
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/bin/gherkin
cucumber-gherkin-26.2.0 bin/gherkin
cucumber-gherkin-26.1.0 bin/gherkin
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/bin/gherkin
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/bin/gherkin
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/bin/gherkin
cucumber-gherkin-26.0.3 bin/gherkin
cucumber-gherkin-26.0.2 bin/gherkin
cucumber-gherkin-26.0.1 bin/gherkin
cucumber-gherkin-26.0.0 bin/gherkin
cucumber-gherkin-25.0.2 bin/gherkin
cucumber-gherkin-25.0.1 bin/gherkin
cucumber-gherkin-25.0.0 bin/gherkin
cucumber-gherkin-24.1.0 bin/gherkin
cucumber-gherkin-24.0.0 bin/gherkin
cucumber-gherkin-23.0.1 bin/gherkin
cucumber-gherkin-23.0.0 bin/gherkin
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-gherkin-22.0.0/bin/gherkin