Perhaps this has already been covered, but I discovered this idiom for doing a descending sort using sort_by.
arr = Array.new
(0..20).each {|i| arr.push sprintf('%02d', i)}
p arr
#=>["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
arr = arr.sort_by {|i| [i.slice(0,2).tr('0-9','9876543210')]} # descending sort using 9's complement
p arr
#=>["20", "19", "18", "17", "16", "15", "14", "13", "12", "11", "10", "09", "08", "07", "06", "05", "04", "03", "02", "01", "00"]
Mike