garrettqmartin8/has_streak — pull request #1 by short-matthew-f (2014-10-16 01:36:38+00:00)
Title: Date fixer

So, I realized this didn't allow for the following streak `[Feb 27th, Feb 28th, Mar 1st, Mar 2nd]` to count since your mapping would convert it to `[28, 27, 2, 1]`.

Also, if your create dates have multiple creations on the same day, or multiple days that are the same (Mar 1st, May 1st, etc) then it will kill actual streaks.

The strategy is to leverage Date's tomorrow method, and to iterate over the dates and store them in arrays of streaks.

`[Feb 1st, Feb 2nd, Feb 4th, Feb 5th, Feb 6th, Feb 8th]` would convert under `to_streaks` to `[ [Feb 1st, Feb 2nd], [Feb 4th, Feb 5th, Feb 6th], [Feb 8th] ]`. Then, `longest_streak` would return `[Feb 4th, Feb 5th, Feb 6th]`, and `determine_consecutive_days` would finally yield `3`, the correct longest streak length.

The extra methods could be used to show the user the actual longest streak, and also all of their streaks, if public method were created to expose the information.