-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort the results of the require_all glob. #4912
Conversation
Filesystems behave differently when performing glob listings. In my environment, they are listed alphabetically. On my Mac, when asking for a list of files in a directory, those files are returned as a nicely sorted list. Alphabetized, like you'd want them to be. Like you'd expect them to be. In some environments, quite different from my own, the return of a similar operation is quite random. Perhaps q comes before a, or e before d; the filesystem will choose its order of the day and you, the fare user, tired and weary from work, must bare the brunt of this. And so, with this commit, I do hereby request that the noble makers of Dir[] provide for us, the downtrodden and ravaged users, some consistency. As a user of Ruby, I shouldn't have to know or consider the behaviour of an individual filesystem here; it should function the same for all filesystems. Truly yours, Parker
Error I am attempting to fix only occurs on certain Linux machines (not travis?):
|
More importantly why do you need it to be sorted? If you need it sorted sounds to me like somebody somewhere is doing something wrong. |
@envygeeks I pasted the error just seconds before you posted your comment; you may have missed it. Sorry I didn't include it in the original post! |
@parkr IMO we should just drop that magic and start doing |
What I mean is |
@envygeeks The funny thing is this has worked for ages... It's only just caused problems today. Why don't we just fix this as-is now and move to a better solution in v3.2.
@envygeeks You mean every file requires its dependencies? That'll be a bit difficult to test, as we could easily miss dependencies... I'm a huge fan of the |
It's those kind of problems/push-offs that lead to what I'm about to say below... sadly.
What do you mean? If you forget to have a dependency load... the tests for that dependency should fail and if they don't that's a problem in and of itself. It should fail the same way that currently does. If you fear that happening then I think all development need be stalled until the tests are brought up to snuff. |
This wasn't a problem before and I just want to get a 3.1.5 out the door tonight with a fix for the above NameError. Feel free to submit a PR to take this PR's place if you want.
I think we're talking past each other here – I mean that in our unit tests, these won't necessarily fail because one file could load, say |
I agree! |
Filesystems behave differently when performing glob listings.
In my environment, they are listed alphabetically. On my Mac, when asking for a list of files in a directory, those files are returned as a nicely sorted list. Alphabetized, like you'd want them to be. Like you'd expect them to be.
In some environments, quite different from my own, the return of a similar operation is quite random. Perhaps q comes before a, or e before d; the filesystem will choose its order of the day and you, the fare user, tired and weary from work, must bare the brunt of this.
And so, with this commit, I do hereby request that the noble makers of Dir[] provide for us, the downtrodden and ravaged users, some consistency. As a user of Ruby, I shouldn't have to know or consider the behaviour of an individual filesystem here; it should function the same for all filesystems.
Truly yours,
Parker.