From ffc068c9bba4c731b06f7e4391fb6a33e101f334 Mon Sep 17 00:00:00 2001 From: hsbt Date: Sun, 10 Aug 2014 01:34:50 +0000 Subject: * 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 --- sample/open3.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sample/open3.rb (limited to 'sample/open3.rb') 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 -- cgit v1.2.3