[ruby-dev:50087] [Ruby trunk Feature#11302] Dir.entries and Dir.foreach without [".", ".."]

From: nobu@...
Date: 2017-04-19 02:06:11 UTC
List: ruby-dev #50087
Issue #11302 has been updated by nobu (Nobuyoshi Nakada).


red (Arnaud Rouyer) wrote:
> Basing myself on the GNU ls util, I propose supporting an `:ignore` key in the optional hash argument.

> ~~~ruby
> irb:002> Dir.entries('.', ignore: :almost_all)  # almost_all option name taken from GNU ls option name

`ignore: :almost_all` seems like that almost all files will be ignored and only '.' and '..' will be returned.


----------------------------------------
Feature #11302: Dir.entries and Dir.foreach without [".", ".."]
https://bugs.ruby-lang.org/issues/11302#change-64380

* Author: naruse (Yui NARUSE)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Dir.entries returns an array of its content with "." and "..".
But as far as I met, almost all cases don't need them.

How about adding such new method or options?



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next