# RangeBuilder Builds ranges from an enumeration ## Installation Add this line to your application's Gemfile: gem 'range_builder' And then execute: $ bundle Or install it yourself as: $ gem install range_builder ## Usage persons = [15, 60, 15, 61, 59, 19].map{|age| Person.new(age: age) } RangeBuilder.build_range( persons ){|person| person.age } # returns range from mininal to maximal data: # ( <Person aged 15> .. <Person aged 61> ) sorted_array = [ 2, 3, 4, 6, 7, 9, 11, 12, 13] # sorted_array must be sorted and elements must implement successor: #succ RangeBuilder.build_from_sorted(sorted_array) # returns array of ranges: # [ (2..4), (6..7), (9..9), (11..13) ] ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request