selection sort in ruby