class Croaky::IoStreamBuilder

Builds an IoStream based on the platform.

Public Instance Methods

build() click to toggle source
# 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

Private Instance Methods

java_stderr_stream() click to toggle source
# File lib/croaky/io_stream_builder.rb, line 32
def java_stderr_stream
  require 'croaky/stream/java_std_err_stream'
  Stream::JavaStdErrStream.new
end
java_stdout_stream() click to toggle source
# File lib/croaky/io_stream_builder.rb, line 22
def java_stdout_stream
  require 'croaky/stream/java_std_out_stream'
  Stream::JavaStdOutStream.new
end
ruby_stderr_stream() click to toggle source
# File lib/croaky/io_stream_builder.rb, line 27
def ruby_stderr_stream
  require 'croaky/stream/std_err_stream'
  Stream::StdErrStream.new
end
ruby_stdout_stream() click to toggle source
# File lib/croaky/io_stream_builder.rb, line 17
def ruby_stdout_stream
  require 'croaky/stream/std_out_stream'
  Stream::StdOutStream.new
end