[macruby-changes] [MacRuby/MacRuby] 9345af: IO.popen will return/yield subclass instances base...
noreply at github.com
noreply at github.com
Tue May 3 20:46:04 PDT 2011
Branch: refs/heads/master
Home: https://github.com/MacRuby/MacRuby
Commit: 9345af1ff62bc770dd9a5bc3e25db4dbd7a588c3
https://github.com/MacRuby/MacRuby/commit/9345af1ff62bc770dd9a5bc3e25db4dbd7a588c3
Author: Watson <watson1978 at gmail.com>
Date: 2011-05-03 (Tue, 03 May 2011)
Changed paths:
M io.c
Log Message:
-----------
IO.popen will return/yield subclass instances based on receiver.
Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
class SubIO < IO; end
ruby = "ruby"
args = ['-e', '$>.write($<.read)']
f = SubIO.popen([ruby] + args, 'r+')
assert_equal(SubIO, f.class)
f.close
SubIO.popen([ruby] + args, 'r+') { |io|
assert_equal(SubIO, io.class)
}
puts :ok
}}}
More information about the macruby-changes
mailing list