From: "Jesús Gabriel y Galán" Date: 2007-09-26T17:18:58+09:00 Subject: Re: Detecting number ranges On 9/26/07, Jay Levitt wrote: > I had to write a script this evening to take an unsorted input file of the > form: > > database 1 is on server 3 > database 8 is on server 7 > ... > > and output it in the form: > > server 3 handles database 1 through 7 > server 7 handles database 8 through 11 > > I feel like there's a much nicer way to express this in Ruby, but can't > think of what it might be... Does this feel nicer? $ cat db_ranges.rb && ruby db_ranges.rb # db_ranges.rb # 26 September 2007 # require 'enumerator' file =<