class Gherkin::Stream::SubprocessMessageStream

Public Class Methods

new(gherkin_executable, paths, print_source, print_ast, print_pickles) click to toggle source
# File lib/gherkin/stream/subprocess_message_stream.rb, line 7
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

Public Instance Methods

messages() click to toggle source
# File lib/gherkin/stream/subprocess_message_stream.rb, line 11
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