mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b16baa9272
commit
ca138145f5
1 changed files with 16 additions and 2 deletions
18
lib/open3.rb
18
lib/open3.rb
|
@ -239,13 +239,13 @@ module Open3
|
||||||
#
|
#
|
||||||
# # generate a thumnail image using the convert command of ImageMagick.
|
# # generate a thumnail image using the convert command of ImageMagick.
|
||||||
# # However, if the image stored really in a file,
|
# # 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.
|
# # because memory consumption.
|
||||||
# # But if the image is stored in a DB or generated by gnuplot Open3.capture2 example,
|
# # But if the image is stored in a DB or generated by gnuplot Open3.capture2 example,
|
||||||
# # Open3.capture3 is considerable.
|
# # Open3.capture3 is considerable.
|
||||||
# #
|
# #
|
||||||
# image = File.read("/usr/share/openclipart/png/animals/mammals/sheep-md-v0.1.png", :binmode=>true)
|
# 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?
|
# if s.success?
|
||||||
# STDOUT.binmode; print thumnail
|
# STDOUT.binmode; print thumnail
|
||||||
# end
|
# end
|
||||||
|
@ -548,6 +548,20 @@ module Open3
|
||||||
# # count lines
|
# # count lines
|
||||||
# Open3.pipeline("sort", "uniq -c", :in=>"names.txt", :out=>"count")
|
# 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)
|
def pipeline(*cmds)
|
||||||
if Hash === cmds.last
|
if Hash === cmds.last
|
||||||
opts = cmds.pop.dup
|
opts = cmds.pop.dup
|
||||||
|
|
Loading…
Add table
Reference in a new issue