るりまサーチ

最速Rubyリファレンスマニュアル検索!
123件ヒット [1-100件を表示] (0.089秒)
トップページ > クエリ:-[x] > クエリ:pipeline[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Open3.#pipeline(*cmds) -> [Process::Status] (18225.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
.../share/man/man1/ruby.1.gz"
p Open3.pipeline(["zcat", fname], "nroff -man", "less")
#=> [#<Process::Status: pid 11817 exit 0>,
# #<Process::Status: pid 11820 exit 0>,
# #<Process::Status: pid 11828 exit 0>]

例2:

require "open3"

Open3.pipeline([{"LANG"=>"C"}, "env"], ["grep", "LA...

Open3.#pipeline_r(*cmds) -> [IO, [Thread]] (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...実行したプロセスを待つためのスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_r("yes", "head -10") {|r, ts|
p r.read #=> "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"
p ts[0].value #=> #<Process::Status: pid 24910 SIGPIPE (signal 13)...

Open3.#pipeline_r(*cmds) {|last_stdout, wait_thrs| ... } -> () (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...実行したプロセスを待つためのスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_r("yes", "head -10") {|r, ts|
p r.read #=> "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"
p ts[0].value #=> #<Process::Status: pid 24910 SIGPIPE (signal 13)...

Open3.#pipeline_rw(*cmds) -> [IO, IO, [Thread]] (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...実行したプロセスを待つため
のスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る...

Open3.#pipeline_rw(*cmds) {|first_stdin, last_stdout, wait_thrs| ... } -> () (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...実行したプロセスを待つため
のスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る...

絞り込み条件を変える

Open3.#pipeline_w(*cmds) -> [IO, [Thread]] (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事ができます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...た場合は最初に実行するコマンドの標準入力、
実行したプロセスを待つためのスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_w("bzip2 -c", :out=>"/tmp/hello.bz2") {|w, ts|
w.puts "hello"
}

@see Open3.#popen3...

Open3.#pipeline_w(*cmds) {|first_stdin, wait_thrs| ... } -> () (6220.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事ができます。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...た場合は最初に実行するコマンドの標準入力、
実行したプロセスを待つためのスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_w("bzip2 -c", :out=>"/tmp/hello.bz2") {|w, ts|
w.puts "hello"
}

@see Open3.#popen3...

Open3.#pipeline_start(*cmds) -> [Thread] (6214.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...スを待つためのスレッ
ドの配列を返します。

例:

require "open3"

# xeyesを10秒だけ実行する。
Open3.pipeline_start("xeyes") {|ts|
sleep 10
t = ts[0]
Process.kill("TERM", t.pid)
p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>...

Open3.#pipeline_start(*cmds) {|wait_thrs| ... } -> () (6214.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。

...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H...
...スを待つためのスレッ
ドの配列を返します。

例:

require "open3"

# xeyesを10秒だけ実行する。
Open3.pipeline_start("xeyes") {|ts|
sleep 10
t = ts[0]
Process.kill("TERM", t.pid)
p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>...

Method#<<(callable) -> Proc (112.0)

self と引数を合成した Proc を返します。

...uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT

pipeline
= method(:pp) << WordScanner << File.method(:read)
pipeline
.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Proc#<<, Proc#>>...

絞り込み条件を変える

<< 1 2 > >>