Project

General

Profile

Actions

Bug #18158

open

Pathname#each_entry without block does not return Enumerator

Added by znz (Kazuhiro NISHIYAMA) about 2 months ago. Updated about 1 month ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:105185]

Description

Pathname#each_child without block returns Enumerator.
But Pathname#each_entry without block does not return Enumerator.

% ruby -r pathname -e 'p Pathname(".").each_child.class'
Enumerator
% ruby -r pathname -e 'p Pathname(".").each_entry.class'
-e:1:in `foreach': no block given (LocalJumpError)
    from -e:1:in `each_entry'
    from -e:1:in `<main>'

Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

I've submitted a pull request to have Pathname#each_entry return Enumerator: https://github.com/ruby/pathname/pull/10

Actions

Also available in: Atom PDF