lib/pleasant_path/pathname.rb
# Iterates over all (recursive) descendent files of the directory
# indicated by the Pathname.  Iterated Pathnames are prefixed by the
# original Pathname, and are in depth-first order.
#
# If a block is given, each descendent Pathname is yielded, and this
# method returns the original Pathname.  Otherwise, an Enumerator is
# returned.
#
# @see https://docs.ruby-lang.org/en/master/Pathname.html#method-i-find Pathname#find
#
# @overload find_files(&block)
#   @yieldparam descendent [Pathname]
#   @return [self]
#
# @overload find_files()
#   @return [Enumerator<Pathname>]
Iterates over all (recursive) descendent files of the directory
indicated by the Pathname.  Iterated Pathnames are prefixed by the
original Pathname, and are in depth-first order.

If a block is given, each descendent Pathname is yielded, and this
method returns the original Pathname.  Otherwise, an Enumerator is
returned.
Iterates over all ( recursive ) descendent files of the directory indicated by the Pathname . Iterated Pathnames are prefixed by the original Pathname and are in depth - first order . If a block is given each descendent Pathname is yielded and this method returns the original Pathname . Otherwise an Enumerator is returned .
def find_files
    return to_enum(__method__) unless block_given?
    self.find do |path|
      yield path if path.file?
    end
    self
  end
def find_files return to_enum ( __method__ ) unless block_given? self . find do | path | yield path if path . file? end self end
Iterates over all (recursive) descendent files of the directory
indicated by the Pathname.
Iterates over all ( recursive ) descendent files of the directory indicated by the Pathname .
see
None
overload
find_files(█) @yieldparam descendent [Pathname] @return [self]
find_files ( █ ) @yieldparam descendent [ Pathname ] @return [ self ]
overload
find_files() @return [Enumerator]
find_files () @return [ Enumerator ]