Sha256: e0ee1562ac1dcd18f496a82145b632bea503c16ae181278b5d2b5055801ca99c

Contents?: true

Size: 794 Bytes

Versions: 14

Compression:

Stored size: 794 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

  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

14 entries across 14 versions & 1 rubygems

Version Path
cucumber-gherkin-18.1.1 lib/gherkin.rb
cucumber-gherkin-18.1.0 lib/gherkin.rb
cucumber-gherkin-18.0.0 lib/gherkin.rb
cucumber-gherkin-17.0.2 lib/gherkin.rb
cucumber-gherkin-17.0.1 lib/gherkin.rb
cucumber-gherkin-17.0.0 lib/gherkin.rb
cucumber-gherkin-16.0.0 lib/gherkin.rb
cucumber-gherkin-15.0.2 lib/gherkin.rb
cucumber-gherkin-15.0.1 lib/gherkin.rb
cucumber-gherkin-15.0.0 lib/gherkin.rb
cucumber-gherkin-14.2.0 lib/gherkin.rb
cucumber-gherkin-14.1.0 lib/gherkin.rb
cucumber-gherkin-14.0.1 lib/gherkin.rb
cucumber-gherkin-14.0.0 lib/gherkin.rb