Actions
Feature #11052
closed[PATCH] Blockless Pathname#ascend and #descend return Enumerator
[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 9 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?
Updated by hsbt (Hiroshi SHIBATA) over 9 years ago
- Status changed from Open to Assigned
- Assignee set to akr (Akira Tanaka)
Updated by akr (Akira Tanaka) over 9 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.
Actions
Like0
Like0Like0Like0Like0