I have a list of files with a bunch of attributes. One of the attributes is the file name which is how I would like to sort the list. However, the list goes something like t
gem "natural_sort"
list = ["a10", "a", "a20", "a1b", "a1a", "a2", "a0", "a1"] list.sort(&NaturalSort) # => ["a", "a0", "a1", "a1a", "a1b", "a2", "a10", "a20"]