From: "Strech (Sergey Fedorov)" Date: 2021-11-18T13:15:00+00:00 Subject: [ruby-core:106137] [Ruby master Feature#18287] Support nil value for sort in Dir.glob Issue #18287 has been updated by Strech (Sergey Fedorov). nobu (Nobuyoshi Nakada) wrote in #note-14: > Applied in changeset commit:git|89b440bf724b5e670da0fa31c36a7945a7ddc80f. > > ---------- > Expect bool as `sort:` option at glob [Feature #18287] I understand that my code wasn't optimal due to codebase knowledge, but I thought that I will have a chance to contribute. On one hand ��� it's cool that now we have a better code, on the other hand ��� it's quite demotivating to experience such an approach. Anyway, thanks everyone for your time. ---------------------------------------- Feature #18287: Support nil value for sort in Dir.glob https://bugs.ruby-lang.org/issues/18287#change-94735 * Author: Strech (Sergey Fedorov) * Status: Closed * Priority: Normal * Assignee: Strech (Sergey Fedorov) ---------------------------------------- Good day, everyone. I would like to suggest (or question) the support of a `nil` value for `sort` argument in `Dir.glob`. I find this behaviour a bit surprising, here is an example: ``` irb(main):001:0> Dir.glob("brace/a{.js,*}", sort: true) => ["brace/a.js", "brace/a", "brace/a.erb", "brace/a.html.erb", "brace/a.js", "brace/a.js.rjs"] irb(main):001:0> Dir.glob("brace/a{.js,*}", sort: false) => ["brace/a.js", "brace/a.js", "brace/a.html.erb", "brace/a.erb", "brace/a.js.rjs", "brace/a"] irb(main):001:0> Dir.glob("brace/a{.js,*}", sort: nil) => ["brace/a.js", "brace/a", "brace/a.erb", "brace/a.html.erb", "brace/a.js", "brace/a.js.rjs"] ``` As you can see ��� `sort: nil` produces the same results as `sort: true` which is confusing Github link: https://github.com/ruby/ruby/pull/5079 Ruby spec link: https://github.com/ruby/spec/pull/894 -- https://bugs.ruby-lang.org/ Unsubscribe: