Jim Weirich wrote:
> What a timely question!
> 
> Our local XP users group is addressing the exact same issue.  We are
> developing a schedule program for reserving rooms at Children's Hospital. 
> We need to deal with issues like "Schedule this room every third monday of
> the month".
> 
> We decided to use Martin Fowler's Temporal Expressions pattern.  You can
> more about that here: http://martinfowler.com/apsupp/recurring.pdf

I've never heard of that one before!

As Mr. Spock would say: "Fascinating, Captain."

> To summarize, you can create arbitrarily complex temporal expressions by
> using a small set of primitives (e.g. YearInRange, DayOfMonth) and a
> simple set of combining rules (Union, Intersection, Difference).

The need for intersection is obvious. I don't immediately see the need
for union, however.

> For example, you can create simple expressions ...

Hmm, should we overload && and || for these? Maybe someone already has.

> Does this make sense?  Read the PDF for all the gory details.

Reading now.

> And you are in luck.  There are at least two Temporal Expression libraries
> in Ruby.  I have one that is part of the ECal project on RubyForge (I
> haven't published any files yet tho ... but I can if there is a need). 
> The other one is Runt (http://runt.rubyforge.org/) by Matthew Lipper,
> which is also on RubyForge.

Will also check out runt.

Thanks much,
Hal