Sha256: 99bd37193dff29feb4372d56719389bb0ac1f3d557f7ee4801a22aa812653e92

Contents?: true

Size: 849 Bytes

Versions: 21

Compression:

Stored size: 849 Bytes

Contents

require 'open3'
require 'cucumber/messages'

module Gherkin
  module Stream
    class SubprocessMessageStream
      def initialize(gherkin_executable, paths, print_source, print_ast, print_pickles)
        @gherkin_executable, @paths, @print_source, @print_ast, @print_pickles = gherkin_executable, paths, print_source, print_ast, print_pickles
      end

      def messages
        args = [@gherkin_executable]
        args.push('--no-source') unless @print_source
        args.push('--no-ast') unless @print_ast
        args.push('--no-pickles') unless @print_pickles
        args = args.concat(@paths)
        stdin, stdout, stderr, wait_thr = Open3.popen3(*args)
        if(stdout.eof?)
          error = stderr.read
          raise error
        end
        Cucumber::Messages::BinaryToMessageEnumerator.new(stdout)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
cucumber-gherkin-18.1.1 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-18.1.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-18.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-17.0.2 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-17.0.1 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-17.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-16.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-15.0.2 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-15.0.1 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-15.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-14.2.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-14.1.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-14.0.1 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-14.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-13.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-12.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-11.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-10.0.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-9.2.0 lib/gherkin/stream/subprocess_message_stream.rb
cucumber-gherkin-9.1.0 lib/gherkin/stream/subprocess_message_stream.rb