[前][次][番号順一覧][スレッド一覧]

ruby-changes:9049

From: akr <ko1@a...>
Date: Tue, 9 Dec 2008 02:00:51 +0900 (JST)
Subject: [ruby-changes:9049] Ruby:r20586 (trunk): rdoc update.

akr	2008-12-09 02:00:44 +0900 (Tue, 09 Dec 2008)

  New Revision: 20586

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20586

  Log:
    rdoc update.

  Modified files:
    trunk/lib/open3.rb

Index: lib/open3.rb
===================================================================
--- lib/open3.rb	(revision 20585)
+++ lib/open3.rb	(revision 20586)
@@ -239,13 +239,13 @@
   #
   #   # 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 @@
   #   # 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]