るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

モジュール

検索結果

<< 1 2 3 ... > >>

Find.#find(*dirs) -> Enumerator (35260.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...
find
(1) のように dir 配下のすべてのファイルや
ディレクトリを一つずつ引数 file に渡してブロックを実行します。

ディレクトリのシンボリックリンクは辿りません。
また file に渡される順序は不定です。

ブロックを省略...
...umerator を返します。

@param dirs 探索するディレクトリを一つ以上指定します。


例:

require 'find'

Find
.find('/tmp') {|f|
Find
.prune if f == "/tmp/bar"
...
}

あるディレクトリ配下の探索を省略したい場合は上記のように、
Find
.#p...
...用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。

@see find(1), Find.#prune...

Find.#find(*dirs, ignore_error: true) -> Enumerator (35260.0)

find(1) のように dir 配下のすべてのファイルや ディレクトリを一つずつ引数 file に渡してブロックを実行します。

...
find
(1) のように dir 配下のすべてのファイルや
ディレクトリを一つずつ引数 file に渡してブロックを実行します。

ディレクトリのシンボリックリンクは辿りません。
また file に渡される順序は不定です。

ブロックを省略...
...Enumerator を返します。

@param dirs 探索するディレクトリを一つ以上指定します。

@param ignore_error 探索中に発生した例外を無視するかどうかを指定します。

例:

require 'find'

Find
.find('/tmp') {|f|
Find
.prune if f == "/tmp/bar"
.....
...
Find
.#prune を使用します。この例では "/tmp/bar"
配下のファイルやディレクトリを探索しません。prune の代わりに
d:spec/control#next を使用した場合、"/tmp/bar" 自体をスキップする
だけで、その配下の探索は続行されます。

@see find...

Gem::GemPathSearcher#find(path) -> Gem::Specification | nil (21307.0)

与えられたパスにマッチする Gem::Specification を一つだけ返します。

...与えられたパスにマッチする Gem::Specification を一つだけ返します。

@see Enumerable#find...

Pathname#find -> Enumerator (21232.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...すべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find
.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

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


@see Find.#find...

Pathname#find {|pathname| ...} -> nil (21232.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...すべてのファイルやディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find
.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

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


@see Find.#find...

絞り込み条件を変える

Pathname#find(ignore_error: true) -> Enumerator (21232.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...ディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find
.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

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

@param ignore_error 探索中に発生した...
...例外を無視するかどうかを指定します。

@see Find.#find...

Pathname#find(ignore_error: true) {|pathname| ...} -> nil (21232.0)

self 配下のすべてのファイルやディレクトリを 一つずつ引数 pathname に渡してブロックを実行します。

...ディレクトリを
一つずつ引数 pathname に渡してブロックを実行します。

require 'find'
Find
.find(self.to_s) {|f| yield Pathname.new(f)}

と同じです。

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

@param ignore_error 探索中に発生した...
...例外を無視するかどうかを指定します。

@see Find.#find...

Gem::CommandManager#find_command(command_name) -> Gem::Command | nil (18401.0)

登録されているコマンドからマッチしたものを返します。

...れているコマンドからマッチしたものを返します。

@param command_name コマンド名を文字列で指定します。

@return Gem::Command のサブクラスのインスタンスを返します。

@raise RuntimeError マッチする可能性のあるコマンドが複数あ...

Gem::CommandManager#find_command_possibilities(command_name) -> Array (18301.0)

登録されているコマンドでマッチする可能性のあるものを返します。

...登録されているコマンドでマッチする可能性のあるものを返します。

@param command_name コマンド名を文字列で指定します。...

Enumerable#find(ifnone = nil) -> Enumerator (18220.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...none を call した結果を返します。

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

@param ifnone call メソッドを持つオブジェクト (例えば Proc) を指定します。

//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i %...
...3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...

絞り込み条件を変える

Encoding.find(name) -> Encoding (18207.0)

指定された name という名前を持つ Encoding オブジェクトを返します。

...指定された name という名前を持つ Encoding オブジェクトを返します。

@param name エンコーディング名を表す String を指定します。
@return 発見された Encoding オブジェクトを返します。
@raise ArgumentError 指定した名前のエンコーデ...
...ロケールエンコーディングを表す locale、default_external を表す external、default_internal を表す internal、ファイルシステムエンコーディングを表す filesystem があります。

//emlist[例][ruby]{
p Encoding.find("utf-8") #=> #<Encoding:UTF-8>
//}...

Enumerable#find(ifnone = nil) {|item| ... } -> object (18120.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...none を call した結果を返します。

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

@param ifnone call メソッドを持つオブジェクト (例えば Proc) を指定します。

//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i %...
...3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...
<< 1 2 3 ... > >>