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
As long as files are always named "file #", you could do
"file #"
files.sort_by{|f| f.name.split(" ")[1].to_i }
This splits on the space, and grabs the number to do the sorting.