fnando/recurrence — pull request #12 by nbibler (2011-11-09 20:13:32+00:00)
Title: Add a :through option for event generation limitation

This pull request adds a `:through` option to Recurrence events which will guarantee that you always get a final date that is equal to or greater than the given Date.

```ruby
r = Recurrence.new(:every => :month, :on => 15, :starts => Date.parse('2011-11-09'))
# => #nil}, ...>
r.events(:through => Date.parse('2012-01-01'))
# => [Tue, 15 Nov 2011, Thu, 15 Dec 2011, Sun, 15 Jan 2012]

r = Recurrence.new(:every => :month, :on => 15, :starts => Date.parse('2011-11-09'), :through => Date.parse('2012-01-01'))
# => #Sun, 01 Jan 2012}, ...>
r.events
# => [Tue, 15 Nov 2011, Thu, 15 Dec 2011, Sun, 15 Jan 2012]
```

This is conceptually a sister option to `:until`, limiting the total number of recurring events. The two options are not necessarily mutually exclusive, but one should be careful using both simultaneously. ;)