[ruby-core:96824] [Ruby master Feature#8709] Dir.glob should return sorted file list

From: deivid.rodriguez@...
Date: 2020-01-13 10:04:42 UTC
List: ruby-core #96824
Issue #8709 has been updated by deivid (David Rodr=EDguez).


I got bit by this in the past too when trying to reproduce order dependent =
test failures (https://github.com/rubygems/rubygems/pull/2626#discussion_r2=
54020218).

----------------------------------------
Feature #8709: Dir.glob should return sorted file list
https://bugs.ruby-lang.org/issues/8709#change-83821

* Author: tommorris (Tom Morris)
* Status: Open
* Priority: Normal
* Assignee: =

* Target version: =

----------------------------------------
On OS X, Dir.glob and Dir[] return an ordered list of files.

On Ubuntu Linux, they do not and one must manually sort them.

Returning a list of files that isn't in order fails the Principle of Least =
Astonishment.

I attach a unit test to demonstrate ideal behaviour.

---Files--------------------------------
globtest.rb (454 Bytes)


-- =

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

Unsubscribe: <mailto:[email protected]?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread