Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: bec0df721d7cbb158ef528f26a8ae1c4e803e98c https://github.com/MacRuby/MacRuby/commit/bec0df721d7cbb158ef528f26a8ae1c4e8... Author: Watson <watson1978@gmail.com> Date: 2011-05-04 (Wed, 04 May 2011) Changed paths: M io.c Log Message: ----------- IO.pipe will support a block. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions class SubIO < IO; end x = nil ret = SubIO.pipe {|r, w| x = [r,w] assert_instance_of(SubIO, r) assert_instance_of(SubIO, w) Thread.start do w.print "abc" w.close end assert_equal("abc", r.read) assert(!r.closed?) assert(w.closed?) :foooo } assert_equal(:foooo, ret) assert(x[0].closed?) assert(x[1].closed?) puts :ok }}}