Want to sort an array like this:
arr = ['4.1.5', '4.1.1', '4.1.2', '10.1']
Expected:
['4.1.1', '4.1.2', '4.1.5', '10.1']
Got:
["10.1", "4.1.1", "4.1.2", "4.1.5"]
What I've tried:
arr.sort(&:to_i)
and arr.sort(&:to_f)
but none of them handle the double dots