diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-08 17:00:44 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-08 17:00:44 +0000 |
commit | ca138145f51e527901a4a498ef71592778fa1c83 (patch) | |
tree | fcbbde5fdb5151569788a9b62ea30a42d0c3939b | |
parent | b16baa9272fbc9309614a625f7a1ad4876d6c839 (diff) | |
download | ruby-ca138145f51e527901a4a498ef71592778fa1c83.tar.gz |
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/open3.rb | 18 |
1 files 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 |