From ca138145f51e527901a4a498ef71592778fa1c83 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 8 Dec 2008 17:00:44 +0000 Subject: [PATCH] rdoc update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/open3.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/open3.rb b/lib/open3.rb index 6e5ba3dbd4..d65e86db8b 100644 --- a/lib/open3.rb +++ b/lib/open3.rb @@ -239,13 +239,13 @@ module Open3 # # # generate a thumnail image using the convert command of ImageMagick. # # However, if the image stored really in a file, - # # system("convert", "-thumbnail", "80", filename, "png:-") is better + # # system("convert", "-thumbnail", "80", "png:#{filename}", "png:-") is better # # because memory consumption. # # But if the image is stored in a DB or generated by gnuplot Open3.capture2 example, # # Open3.capture3 is considerable. # # # image = File.read("/usr/share/openclipart/png/animals/mammals/sheep-md-v0.1.png", :binmode=>true) - # thumnail, err, s = Open3.capture3("convert -thumbnail 80 - png:-", :stdin_data=>image, :binmode=>true) + # thumnail, err, s = Open3.capture3("convert -thumbnail 80 png:- png:-", :stdin_data=>image, :binmode=>true) # if s.success? # STDOUT.binmode; print thumnail # end @@ -548,6 +548,20 @@ module Open3 # # count lines # Open3.pipeline("sort", "uniq -c", :in=>"names.txt", :out=>"count") # + # # cyclic pipeline + # r,w = IO.pipe + # w.print "ibase=14\n10\n" + # Open3.pipeline("bc", "tee /dev/tty", :in=>r, :out=>w) + # #=> 14 + # # 18 + # # 22 + # # 30 + # # 42 + # # 58 + # # 78 + # # 106 + # # 202 + # def pipeline(*cmds) if Hash === cmds.last opts = cmds.pop.dup