Use Enumerable#find to iterate over the candidate directories, not Enumerable#each.
This gives the code a more functional "feel", and also makes it - IMO - slightly more idiomatic, as it avoids setting the "global" (by which I mean: non-local)tmp variable from inside the block.
@nobu / @hsbt - I hope you don't mind me tagging you on this PR as the two active maintainers of this repo, and I hope you'll consider my suggested changes! :sweat_smile:
Use
Enumerable#find
to iterate over the candidate directories, notEnumerable#each
.This gives the code a more functional "feel", and also makes it - IMO - slightly more idiomatic, as it avoids setting the "global" (by which I mean: non-local)
tmp
variable from inside the block.