Skip to content
instance method

Pathname#find

(?ignore_error: ::boolish) { (::Pathname) -> untyped } -> nil
(?ignore_error: ::boolish) -> ::Enumerator[::Pathname, nil]
find(ignore_error: true) { |pathname| ... }

Iterates over the directory tree in a depth first manner, yielding a Pathname for each file under “this” directory.

Note that you need to require ‘pathname’ to use this method.

Returns an Enumerator if no block is given.

Since it is implemented by the standard library module Find, Find.prune can be used to control the traversal.

If self is ., yielded pathnames begin with a filename in the current directory, not ./.

See Find.find

See also #file? #fnmatch #extname #fnmatch? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0