From fe928bee67cdc4a99ec8433e3d3531ecede89d4c Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 15 Dec 2004 16:01:11 +0000 Subject: * ext/syck/rubyext.c (rb_syck_io_str_read): [ruby-core:03973] * object.c (rb_obj_id_obsolete): warn always. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/open3.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/open3.rb b/lib/open3.rb index 407cd7662..1ddd213f6 100644 --- a/lib/open3.rb +++ b/lib/open3.rb @@ -9,6 +9,13 @@ # or # include Open3 # stdin, stdout, stderr = popen3('nroff -man') +# +# popen3 can also take a block which will receive stdin, stdout and stderr +# as parameters. This ensures stdin, stdout and stderr are closed once +# the block exits. +# +# Such as +# Open3.popen3('nroff -man') { |stdin, stdout, stderr| ... } module Open3 #[stdin, stdout, stderr] = popen3(command); -- cgit