Sha256: 7db4383b6245550198bdaf63f65f35b7eac3f0085b592e173b449a8e131a19ae

Contents?: true

Size: 721 Bytes

Versions: 15

Compression:

Stored size: 721 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'cucumber/messages'
require 'cucumber/html_formatter'

formatter = Cucumber::HTMLFormatter::Formatter.new(STDOUT)

option_parser = OptionParser.new do |opts|
  opts.on '-f', '--format=ndjson|protobuf', 'Input format'

  opts.on_tail("-h", "--help", "Show this message") do
    puts opts
    exit
  end
end
options = {}
option_parser.parse!(into: options)
format = options[:format] || 'ndjson'
message_enumerator = case format
when 'ndjson'
  Cucumber::Messages::NdjsonToMessageEnumerator.new(STDIN)
when 'protobuf'
  Cucumber::Messages::BinaryToMessageEnumerator.new(STDIN)
else
  raise "Unsupported format: '#{format}'"
end

formatter.process_messages(message_enumerator)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cucumber-html-formatter-13.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-12.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-11.0.2 bin/cucumber-html-formatter
cucumber-html-formatter-11.0.1 bin/cucumber-html-formatter
cucumber-html-formatter-11.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-9.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-8.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-7.2.0 bin/cucumber-html-formatter
cucumber-html-formatter-7.1.0 bin/cucumber-html-formatter
cucumber-html-formatter-7.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-6.0.3 bin/cucumber-html-formatter
cucumber-html-formatter-6.0.2 bin/cucumber-html-formatter
cucumber-html-formatter-6.0.1 bin/cucumber-html-formatter
cucumber-html-formatter-5.0.0 bin/cucumber-html-formatter
cucumber-html-formatter-4.3.0 bin/cucumber-html-formatter