Hi everyone!
I've found that executing an external programs via ruby binding is
somewhat broken (assuming Ruby version 1.9.2 or higher):
:ruby puts `pwd`
Error detected while processing command line:
NoMethodError: undefined method `flush' for #<Object:0x00000001d26f80>
Ruby binding redefines stdout object, but it seems that Ruby 1.9
assumes that IO objects implement 'flush' methods thus the above
error.
The following patch should fix it:
diff -r 161d01cbb165 src/if_ruby.c
--- a/src/if_ruby.c Fri Apr 13 23:04:47 2012 +0200
+++ b/src/if_ruby.c Mon Apr 16 11:19:40 2012 -0400
@@ -1251,6 +1251,11 @@
return Qnil;
}
+static VALUE f_nop(VALUE self)
+{
+ return Qnil;
+}
+
static void ruby_io_init(void)
{
#ifndef DYNAMIC_RUBY
@@ -1259,6 +1264,7 @@
rb_stdout = rb_obj_alloc(rb_cObject);
rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
+ rb_define_singleton_method(rb_stdout, "flush", f_nop, 0);
rb_define_global_function("p", f_p, -1);
}
--
Kent Sibilev
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php