D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Open3
/
Filename :
pipeline-i.ri
back
Copy
U:RDoc::AnyMethod[iI" pipeline:ETI"Open3#pipeline;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Basically a wrapper for ;TI"-{Process.spawn}[rdoc-ref:Process.spawn] ;TI" that:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I":Creates a child process for each of the given +cmds+ ;TI"by calling Process.spawn.;To;;0; [o; ; [I"JPipes the +stdout+ from each child to the +stdin+ of the next child, ;TI"6or, for the last child, to the caller's +stdout+.;To;;0; [o; ; [I"+Waits for the child processes to exit.;To;;0; [o; ; [I"FReturns an array of Process::Status objects (one for each child).;T@o; ; [I" Example:;T@o:RDoc::Markup::Verbatim; [I"3wait_threads = Open3.pipeline('ls', 'grep R') ;TI"[# => [#<Process::Status: pid 2139200 exit 0>, #<Process::Status: pid 2139202 exit 0>] ;T:@format0o; ; [I"Output:;T@o;; [I"Rakefile ;TI"README.md ;T;0o; ; [I"LLike Process.spawn, this method has potential security vulnerabilities ;TI"%if called with untrusted input; ;TI"Psee {Command Injection}[rdoc-ref:command_injection.rdoc@Command+Injection].;T@o; ; [I"HIf the first argument is a hash, it becomes leading argument +env+ ;TI"$in each call to Process.spawn; ;TI"Isee {Execution Environment}[rdoc-ref:Process@Execution+Environment].;T@o; ; [I"LIf the last argument is a hash, it becomes trailing argument +options+ ;TI"$in each call to Process.spawn' ;TI"Asee {Execution Options}[rdoc-ref:Process@Execution+Options].;T@o; ; [I"1Each remaining argument in +cmds+ is one of:;T@o;; ;;[o;;0; [o; ; [I"GA +command_line+: a string that begins with a shell reserved word ;TI"Aor special built-in, or contains one or more metacharacters.;To;;0; [o; ; [I"BAn +exe_path+: the string path to an executable to be called.;To;;0; [o; ; [I"<An array containing a +command_line+ or an +exe_path+, ;TI">along with zero or more string arguments for the command.;T@o; ; [I"aSee {Argument command_line or exe_path}[rdoc-ref:Process@Argument+command_line+or+exe_path].;T: @fileI"lib/open3.rb;T:0@omit_headings_from_table_of_contents_below0I"FOpen3.pipeline([env, ] *cmds, options = {}) -> array_of_statuses ;T0[ I"(*cmds);T@_FI" Open3;TcRDoc::NormalModule00