зеркало из https://github.com/github/ruby.git
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b16baa9272
Коммит
ca138145f5
18
lib/open3.rb
18
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче