るりまサーチ

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

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Shell::Filter#|(filter) -> object (21236.0)

パイプ結合を filter に対して行います。

...合を filter に対して行います。

@param filter Shell::Filter オブジェクトを指定します。

@return filter を返します。

使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Shell.new
sh....
...transact {
i = 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end
}...

Enumerable#collect_concat {| obj | block } -> Array (15414.0)

各要素をブロックに渡し、その返り値を連結した配列を返します。

...ックに渡し、その返り値を連結した配列を返します。

ブロックの返り値は基本的に配列を返すべきです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}...

Enumerable#collect_concat -> Enumerator (15214.0)

各要素をブロックに渡し、その返り値を連結した配列を返します。

...ックに渡し、その返り値を連結した配列を返します。

ブロックの返り値は基本的に配列を返すべきです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}...

Thread#backtrace_locations(range) -> [Thread::Backtrace::Location] | nil (12502.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...ースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレー...
...ます。

Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
/...
.../}

@see Thread::Backtrace::Location...

Thread#backtrace_locations(start = 0, length = nil) -> [Thread::Backtrace::Location] | nil (12502.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...ースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレー...
...ます。

Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
/...
.../}

@see Thread::Backtrace::Location...

絞り込み条件を変える

Kernel.#caller_locations(range) -> [Thread::Backtrace::Location] | nil (12402.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...

//emlist[例][ruby]{
def test1(start, length)
l
ocations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []...
...test3(1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:1...

Kernel.#caller_locations(start = 1, length = nil) -> [Thread::Backtrace::Location] | nil (12402.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...

//emlist[例][ruby]{
def test1(start, length)
l
ocations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []...
...test3(1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:1...

Gem::SourceIndex.load_specification(file_name) -> Gem::Specification | nil (12401.0)

与えられたファイル名から Ruby スクリプト形式の gemspec をロードして Gem::Specification のインスタンスを返します。

...ファイル名から Ruby スクリプト形式の gemspec をロードして
Gem::Specification のインスタンスを返します。

@param file_name ファイル名を指定します。

@raise SignalException gemspec をロードしているときに発生します。

@raise SystemExit gems...

Enumerable#flat_map {| obj | block } -> Array (12314.0)

各要素をブロックに渡し、その返り値を連結した配列を返します。

...ックに渡し、その返り値を連結した配列を返します。

ブロックの返り値は基本的に配列を返すべきです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}...

Enumerator::Lazy#collect_concat {|item| ... } -> Enumerator::Lazy (12314.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

...行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下...
...Lazy) とき

それ以外のときは、x は分解されず、そのままの値として使われます。

//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}

@raise ArgumentError ブロックを指定しなかった場合に発生します。

@see Enumerabl...
...e#flat_map...

絞り込み条件を変える

<< 1 2 3 ... > >>