summaryrefslogtreecommitdiff
path: root/lib/open3.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/open3.rb')
-rw-r--r--lib/open3.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/open3.rb b/lib/open3.rb
index 407cd7662c..1ddd213f61 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);