Class: Croaky::IoStreamBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/croaky/io_stream_builder.rb

Overview

Builds an IoStream based on the platform.

Instance Method Summary collapse

Instance Method Details

#buildObject



8
9
10
11
12
13
# File 'lib/croaky/io_stream_builder.rb', line 8

def build
  jruby_platform = defined?(JRUBY_VERSION)
  stdout_stream = jruby_platform ? java_stdout_stream : ruby_stdout_stream
  stderr_stream = jruby_platform ? java_stderr_stream : ruby_stderr_stream
  Croaky::IO::IoStream.new(stdout_stream, stderr_stream)
end