Project

General

Profile

Backport #6798

Pathname#find does not return an enumerator

Added by mistydemeo (Misty De Meo) about 7 years ago. Updated about 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
[ruby-core:46791]

Description

Pathname#find is an interface to Find.find. However, while Find.find returns an enumerator, Pathname#find does not. This means that, for instance, it is not possible to use Pathname#find with other enumerator methods:

files = Find.find('.').select { ... } - works
files = pn.find.select { ... } - does not work


Related issues

Related to Ruby master - Feature #5572: ブロックなしPathname#find呼び出しでEnumeratorを返すClosed11/05/2011Actions

History

Updated by Eregon (Benoit Daloze) about 7 years ago

This was solved in #5572. It is fixed on trunk and will be there for 2.0.

You can use

Pathname(".").to_enum(:find).select { ... }

Would you want it to be backported?

Updated by mistydemeo (Misty De Meo) about 7 years ago

Oh, excellent! I missed that other issue when I was searching.

Having it backported would be very helpful. Thank you!

#3

Updated by Eregon (Benoit Daloze) about 7 years ago

  • Tracker changed from Feature to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (lib)

Should this be backported to 1.9.3?

It adds a new functionality and it's hardly a bug, but one could expect it given Find.find behavior.

Updated by Eregon (Benoit Daloze) about 7 years ago

Posting my reply again, since it seems it did not go to the list:
Eregon (Benoit Daloze) wrote:

Should this be backported to 1.9.3?

It adds a new functionality and it's hardly a bug, but one could expect it given Find.find behavior.

Updated by naruse (Yui NARUSE) about 7 years ago

  • Status changed from Open to Rejected

This is considered as a new feature, so it won't be backported.

Also available in: Atom PDF