Sha256: 8718ccb82bc8e8779f0c640674b8854483028f92dc4fb22cf58dbf63422c0682

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

require_relative 'gherkin/stream/parser_message_stream'

module Gherkin
  DEFAULT_OPTIONS = {
    include_source: true,
    include_gherkin_document: true,
    include_pickles: true
  }.freeze

  def self.from_paths(paths, options = {})
    Stream::ParserMessageStream.new(
      paths,
      [],
      options
    ).messages
  end

  def self.from_sources(sources, options = {})
    Stream::ParserMessageStream.new(
      [],
      sources,
      options
    ).messages
  end

  def self.from_source(uri, data, options = {})
    from_sources([encode_source_message(uri, data)], options)
  end

  def self.encode_source_message(uri, data)
    Cucumber::Messages::Source.new(
      uri: uri,
      data: data,
      media_type: 'text/x.cucumber.gherkin+plain'
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cucumber-gherkin-30.0.0 lib/gherkin.rb