summaryrefslogtreecommitdiff
path: root/lib/open3.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-07 08:45:31 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-07 08:45:31 +0000
commitc0264efadda2353455ef1d009c258f1cb8fda5bb (patch)
treeeb4c7723e2a60efabc493d2c14446c633f0e5ba0 /lib/open3.rb
parent0884ca04bfe1a75f5935821ab4c1442dd5f0e72e (diff)
* lib/open3.rb (Open3.capture3): renamed from Open3.poutput3.
(Open3.capture2): renamed from Open3.poutput2. (lOpen3.capture2e): renamed from Open3.poutput2e. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/open3.rb')
-rw-r--r--lib/open3.rb46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/open3.rb b/lib/open3.rb
index a094773aad..c29a622c1b 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -15,9 +15,9 @@
# - Open3.popen3 : pipes for stdin, stdout, stderr
# - Open3.popen2 : pipes for stdin, stdout
# - Open3.popen2e : pipes for stdin, merged stdout and stderr
-# - Open3.poutput3 : give a string for stdin. get strings for stdout, stderr
-# - Open3.poutput2 : give a string for stdin. get a string for stdout
-# - Open3.poutput2e : give a string for stdin. get a string for merged stdout and stderr
+# - Open3.capture3 : give a string for stdin. get strings for stdout, stderr
+# - Open3.capture2 : give a string for stdin. get a string for stdout
+# - Open3.capture2e : give a string for stdin. get a string for merged stdout and stderr
# - Open3.pipeline_rw : pipes for first stdin and last stdout of a pipeline
# - Open3.pipeline_r : pipe for last stdout of a pipeline
# - Open3.pipeline_w : pipe for first stdin of a pipeline
@@ -201,9 +201,9 @@ module Open3
private :popen_run
end
- # Open3.poutput3 captures the standard output and the standard error of a command.
+ # Open3.capture3 captures the standard output and the standard error of a command.
#
- # stdout_str, stderr_str, status = Open3.poutput3([env,] cmd... [, opts])
+ # stdout_str, stderr_str, status = Open3.capture3([env,] cmd... [, opts])
#
# The arguments cmd and opts are passed to Open3.popen3 except opts[:stdin_data].
#
@@ -219,9 +219,9 @@ module Open3
# a -> b
# }
# End
- # layouted_graph, dot_log = Open3.poutput3("dot -v", :stdin_data=>graph)
+ # layouted_graph, dot_log = Open3.capture3("dot -v", :stdin_data=>graph)
#
- # o, e, s = Open3.poutput3("echo a; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
+ # o, e, s = Open3.capture3("echo a; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
# p o #=> "a\n"
# p e #=> "bar\nbaz\nfoo\n"
# p s #=> #<Process::Status: pid 32682 exit 0>
@@ -230,16 +230,16 @@ module Open3
# # However, if the image stored really in a file,
# # system("convert", "-thumbnail", "80", filename, "png:-") is better
# # because memory consumption.
- # # But if the image is stored in a DB or generated by gnuplot Open3.poutput2 example,
- # # Open3.poutput3 is considerable.
+ # # 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.poutput3("convert -thumbnail 80 - png:-", :stdin_data=>image, :binmode=>true)
+ # thumnail, err, s = Open3.capture3("convert -thumbnail 80 - png:-", :stdin_data=>image, :binmode=>true)
# if s.success?
# STDOUT.binmode; print thumnail
# end
#
- def poutput3(*cmd, &block)
+ def capture3(*cmd, &block)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -262,11 +262,11 @@ module Open3
[out_reader.value, err_reader.value, t.value]
}
end
- module_function :poutput3
+ module_function :capture3
- # Open3.poutput2 captures the standard output of a command.
+ # Open3.capture2 captures the standard output of a command.
#
- # stdout_str, status = Open3.poutput2([env,] cmd... [, opts])
+ # stdout_str, status = Open3.capture2([env,] cmd... [, opts])
#
# The arguments cmd and opts are passed to Open3.popen2 except opts[:stdin_data].
#
@@ -275,7 +275,7 @@ module Open3
# If opts[:binmode] is true, internal pipes are set to binary mode.
#
# # factor is a command for integer factorization.
- # o, s = Open3.poutput2("factor", :stdin_data=>"42")
+ # o, s = Open3.capture2("factor", :stdin_data=>"42")
# p o #=> "42: 2 3 7\n"
#
# # generate x**2 graph in png using gnuplot.
@@ -288,9 +288,9 @@ module Open3
# 4 5
# e
# End
- # image, s = Open3.poutput2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
+ # image, s = Open3.capture2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
#
- def poutput2(*cmd, &block)
+ def capture2(*cmd, &block)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -311,11 +311,11 @@ module Open3
[out_reader.value, t.value]
}
end
- module_function :poutput2
+ module_function :capture2
- # Open3.poutput2e captures the standard output and the standard error of a command.
+ # Open3.capture2e captures the standard output and the standard error of a command.
#
- # stdout_and_stderr_str, status = Open3.poutput2e([env,] cmd... [, opts])
+ # stdout_and_stderr_str, status = Open3.capture2e([env,] cmd... [, opts])
#
# The arguments cmd and opts are passed to Open3.popen2e except opts[:stdin_data].
#
@@ -326,9 +326,9 @@ module Open3
# Example:
#
# # capture make log
- # make_log, s = Open3.poutput2e("make")
+ # make_log, s = Open3.capture2e("make")
#
- def poutput2e(*cmd, &block)
+ def capture2e(*cmd, &block)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -349,7 +349,7 @@ module Open3
[outerr_reader.value, t.value]
}
end
- module_function :poutput2e
+ module_function :capture2e
# Open3.pipeline_rw starts a list of commands as a pipeline with pipes
# which connects stdin of the first command and stdout of the last command.