From 755b86cc0aba32d99ad32e35a518f8fd8497a88a Mon Sep 17 00:00:00 2001 From: toshinagata1964 Date: Sun, 16 Feb 2014 14:50:59 +0000 Subject: [PATCH] $stdout.flush and $stderr.flush are implemented; nothing to do, but required by Kernel.backquote in Ruby 2.0 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@438 a2be9bc6-48de-4e38-9406-05402d4bc13c --- MolLib/Ruby_bind/ruby_bind.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MolLib/Ruby_bind/ruby_bind.c b/MolLib/Ruby_bind/ruby_bind.c index f281ace..ee73099 100644 --- a/MolLib/Ruby_bind/ruby_bind.c +++ b/MolLib/Ruby_bind/ruby_bind.c @@ -386,6 +386,19 @@ s_StandardErrorOutput(VALUE self, VALUE str) /* * call-seq: + * stdout.flush + * stderr.flush + * + * Flush the standard (error) output. Actually do nothing. + */ +static VALUE +s_FlushConsoleOutput(VALUE self) +{ + return self; +} + +/* + * call-seq: * stdin.gets(rs = $/) * * Read one line message via dialog box. @@ -11117,9 +11130,11 @@ Molby_startup(const char *script, const char *dir) /* Create objects for stdout and stderr */ val = rb_funcall(rb_cObject, rb_intern("new"), 0); rb_define_singleton_method(val, "write", s_StandardOutput, 1); + rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0); rb_gv_set("$stdout", val); val = rb_funcall(rb_cObject, rb_intern("new"), 0); rb_define_singleton_method(val, "write", s_StandardErrorOutput, 1); + rb_define_singleton_method(val, "flush", s_FlushConsoleOutput, 0); rb_gv_set("$stderr", val); /* Create objects for stdin */ -- 2.11.0