Compacted Ruby bubble-sort algorithm