public static IRubyObject pipe(ThreadContext context, IRubyObject recv) throws Exception {
// TODO: This isn't an exact port of MRI's pipe behavior, so revisit
Ruby runtime = context.getRuntime();
Pipe pipe = Pipe.open();
RubyIO source = new RubyIO(runtime, pipe.source());
RubyIO sink = new RubyIO(runtime, pipe.sink());
sink.openFile.getMainStream().setSync(true);
return runtime.newArrayNoCopy(new IRubyObject[] { source, sink });
}