In Ruby, how can I take an array of tokens representing either integers or ranges and parse them into an array of integers that include each integer and each element in each range?
Example: Given input [ "5", "7-10", "24", "29-31"]
I'd like to produce output [ 5, 7, 8, 9, 10, 24, 29, 30, 31 ]
Thanks.