lib/pleasant_path/pathname.rb
def find_dirs
    return to_enum(__method__) unless block_given?

    self.find do |path|
      if path.file?
        Find.prune
      elsif path != self
        yield path
      end
    end

    self
  end
# Iterates over all (recursive) descendent directories 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_dirs(&block)
#   @yieldparam descendent [Pathname]
#   @return [self]
#
# @overload find_dirs()
#   @return [Enumerator<Pathname>]
Iterates over all (recursive) descendent directories 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 directories 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_dirs
    return to_enum(__method__) unless block_given?
    self.find do |path|
      if path.file?
        Find.prune
      elsif path != self
        yield path
      end
    end
    self
  end
def find_dirs return to_enum ( __method__ ) unless block_given? self . find do | path | if path . file? Find . prune elsif path != self yield path end end self end
Iterates over all (recursive) descendent directories of the
directory indicated by the Pathname.
Iterates over all ( recursive ) descendent directories of the directory indicated by the Pathname .
see
None
overload
find_dirs(█) @yieldparam descendent [Pathname] @return [self]
find_dirs ( █ ) @yieldparam descendent [ Pathname ] @return [ self ]
overload
find_dirs() @return [Enumerator]
find_dirs () @return [ Enumerator ]