summaryrefslogtreecommitdiff
path: root/lib/open3.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 22:00:31 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-04 22:00:31 +0000
commit91edcb053b3dd0a86ad7cec0a652d084d6e7dd46 (patch)
tree3ebfb81d7fdc03904604b2c7148180d7c6b02cec /lib/open3.rb
parent4d2d744487d6f2ca97d034c7b7d5c2a4836fc5db (diff)
Merge RDoc changes from HEAD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open3.rb')
-rw-r--r--lib/open3.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/open3.rb b/lib/open3.rb
index 59db1a4cc5..f722252b1c 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -3,12 +3,24 @@
# which IO#popen does not allow)
#
# Usage:
-# require "open3"
#
-# stdin, stdout, stderr = Open3.popen3('nroff -man')
-# or
-# include Open3
-# stdin, stdout, stderr = popen3('nroff -man')
+# require "open3"
+#
+# stdin, stdout, stderr = Open3.popen3('nroff -man')
+#
+# 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);