aboutsummaryrefslogtreecommitdiffstats
path: root/sample/open3.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-10 01:34:50 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-10 01:34:50 +0000
commitffc068c9bba4c731b06f7e4391fb6a33e101f334 (patch)
treefa0414841c5611c0b73a6ca0e7b8163e1738466e /sample/open3.rb
parent31a1d0621c391d2d58918d51f0505e3044876822 (diff)
downloadruby-ffc068c9bba4c731b06f7e4391fb6a33e101f334.tar.gz
* lib/cgi/session/pstore.rb: separated sample code.
* lib/open3.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/open3.rb')
-rw-r--r--sample/open3.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/sample/open3.rb b/sample/open3.rb
new file mode 100644
index 0000000000..bc6cdfe3bf
--- /dev/null
+++ b/sample/open3.rb
@@ -0,0 +1,12 @@
+require 'open3'
+
+a = Open3.popen3("nroff -man")
+Thread.start do
+ while line = gets
+ a[0].print line
+ end
+ a[0].close
+end
+while line = a[1].gets
+ print ":", line
+end