runt

How do I find overlaps between two Ruby Runt patterns?

I am developing a Google like calendar on Rails and am using Runt to define the recurrence patterns for creating events. However, the restriction with the calendar is that there cannot be two events for same time slot. So, if i have an event created with event = REDay.new(13,00,15,00) # daily between 1PM to 3 PM Then the application...

Using runt to do recurring non-weekly events in ruby (bi-weekly, every 3 weeks, etc)

I need to be able to create recurring events that happen on specific days but don't necessarily happen every week. They could be scheduled bi-weekly, every 3 weeks, etc. There is a current implementation that needs an update and I'd like to use the temporal expressions stuff from runt to redo it. Runt will work for what I need except ...

Problems with Runt overlap? but *only* within Rails

Martin Fowler's Runt library is really handy for date/time comparisons, and this code works great in an irb console: require 'runt' include Runt r_start = PDate.month(2010,12) r_end = PDate.month(2011,12) range = DateRange.new(r_start,r_end) o_start = PDate.month(2010,11) o_end = PDate.month(2012,2) o_range = DateRange.new(o_start,o_en...

How can I update an expression in a Runt::Schedule object?

Runt provides a Schedule class for managing collections of events, each represented by a temporal expression. The Schedule class provides an update method, cited in the release notes as "allowing clients to update existing expressions". The implementation of this method, however, simply calls a supplied block, providing the temporal expr...