Project

General

Profile

Feature #11052

[PATCH] Blockless Pathname#ascend and #descend return Enumerator

Added by chastell (Piotr Szotkowski) over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:<unknown>]

Description

It would be beneficial for blockless Pathname#ascend and #descend
to return an Enumerator (rather than raise a LocalJumpError).

Example use case of finding the Git root of the current directory:

git_dir = Pathname.new('.git')
Pathname.pwd.ascend.find { |dir| dir.entries.include?(git_dir) }

Files

Updated by chastell (Piotr Szotkowski) over 5 years ago

Apologies if you're busy and I should just wait (happy to do it!), but it's my first non-doc contribution and I'm not sure: is there anything I should add to this feature request?

#3

Updated by hsbt (Hiroshi SHIBATA) about 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to akr (Akira Tanaka)
#4

Updated by akr (Akira Tanaka) about 5 years ago

  • Status changed from Assigned to Closed

Applied in changeset r50897.


  • ext/pathname/lib/pathname.rb (descend): Blockless form supported. (ascend): Ditto. [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski.

Also available in: Atom PDF