るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

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

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

...ame = "/usr/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"], [...

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

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

...ッドを持ったオブジェクト。

//emlist[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
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#>>...

Method#>>(callable) -> Proc (36.0)

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

...ッドを持ったオブジェクト。

//emlist[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3) # => 18
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+...
.../)
end
end

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

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

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

Proc#>>(callable) -> Proc (36.0)

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

...all メソッドを持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }

# (3 * 3) + (3 * 3)
p (f >> g).call(3) # => 18
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)...
...end
end

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

pipeline
= proc { |fname| File.read(fname) } >> WordScanner >> method(:p)
pipeline
.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Method#<<, Method#>>...

Proc#<<(callable) -> Proc (30.0)

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

...all メソッドを持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }

# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)...
...end
end

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

pipeline
= proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline
.call('testfile') # => word count: 4
//}

@see Method#<<, Method#>>...

絞り込み条件を変える