I just released Tempr, a library for lazily building and evaluating temporal expressions. I'd be glad for any comments!
My motivation in writing this was to replace the old Runt library we use in MU's Scheduler, which can't run in Ruby 1.9.x.
What the heck are temporal expressions, you ask?
Say you have an appointment every third Thursday of each month at 12:30pm, for an hour . If you want a list of all such appointments for a given date range, using Tempr it's:
range.extend(Tempr::DateTimeRange) appointments = range.each_month.thursday(2).each_time_of_day("12:30pm", 60*60) appointments.to_a
or you want to know if another time conflicts?
Tempr makes this sort of thing easy, and cleans up code that would otherwise be doing a bunch of low level manual date processing.
February 16, 2012