I am using the ice_cube gem to create schedules. Making a monthly schedule starting on the 31st misses all months with fewer than 31 days. I'd like to schedule the last day of the month on those months. If my schedule starts on the 30th I want the 30th of every month and the last day of February. Leap years complicate the matter further.
What's a good way to create schedules that handles starting on the 29th, 30th or 31st?
This passes all my specs, but is fugly and probably breaks for schedules longer than a year (which I don't care about yet).
So many specs:
-