Sha256: 8ef5e66fbafc19f8950629457e08344135f07b7a00c718b894dddc9a19ed296a

Contents?: true

Size: 785 Bytes

Versions: 6

Compression:

Stored size: 785 Bytes

Contents

require '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

  private

  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

6 entries across 6 versions & 1 rubygems

Version Path
cucumber-gherkin-13.0.0 lib/gherkin.rb
cucumber-gherkin-12.0.0 lib/gherkin.rb
cucumber-gherkin-11.0.0 lib/gherkin.rb
cucumber-gherkin-10.0.0 lib/gherkin.rb
cucumber-gherkin-9.2.0 lib/gherkin.rb
cucumber-gherkin-9.1.0 lib/gherkin.rb