[macruby-changes] [1361] MacRuby/branches/experimental
source_changes at macosforge.org
source_changes at macosforge.org
Sat Apr 4 17:17:11 PDT 2009
Revision: 1361
http://trac.macosforge.org/projects/ruby/changeset/1361
Author: pthomson at apple.com
Date: 2009-04-04 17:17:10 -0700 (Sat, 04 Apr 2009)
Log Message:
-----------
Added three more tests.
Modified Paths:
--------------
MacRuby/branches/experimental/io.c
MacRuby/branches/experimental/rakelib/spec.rake
Modified: MacRuby/branches/experimental/io.c
===================================================================
--- MacRuby/branches/experimental/io.c 2009-04-05 00:01:59 UTC (rev 1360)
+++ MacRuby/branches/experimental/io.c 2009-04-05 00:17:10 UTC (rev 1361)
@@ -794,6 +794,7 @@
rb_io_pid(VALUE io, SEL sel)
{
rb_io_t *io_struct = ExtractIOStruct(io);
+ rb_io_assert_open(io_struct);
return ((io_struct->pid == -1) ? Qnil : INT2FIX(io_struct->pid));
}
@@ -1964,7 +1965,13 @@
rb_scan_args(argc, argv, "11", &process_name, &mode);
if (NIL_P(mode)) mode = (VALUE)CFSTR("r");
StringValue(process_name);
- return io_from_spawning_new_process(process_name, mode);
+ VALUE io = io_from_spawning_new_process(process_name, mode);
+ if (rb_block_given_p()) {
+ VALUE ret = rb_vm_yield(1, &io);
+ rb_io_close_m(io, 0);
+ return ret;
+ }
+ return io;
}
/*
Modified: MacRuby/branches/experimental/rakelib/spec.rake
===================================================================
--- MacRuby/branches/experimental/rakelib/spec.rake 2009-04-05 00:01:59 UTC (rev 1360)
+++ MacRuby/branches/experimental/rakelib/spec.rake 2009-04-05 00:17:10 UTC (rev 1361)
@@ -30,15 +30,19 @@
KNOWN_GOOD_CORE_IO = %w{
closed
+ constants
fileno
fsync
flush
+ getc
io
inspect
+ pid
putc
readchar
sync
syswrite
+ tell
to_i
to_io
initialize
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090404/22bfaee7/attachment.html>
More information about the macruby-changes
mailing list