[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

recurring intervals in ruby

snacktime

1/13/2007 8:05:00 AM

I'm setting about to write a mini language of sorts for defining
recurring intervals that will be used in a recurring billing
application. In the past I wrote a simpler version in perl using the
awsome Date::Manip module, and am looking for the best way to do it in
ruby. I'm not too concerned about the date calculations themselves
I'm mainly thinking about how to parse the language. My first thought
is to just use a parser such as lemon or ragel. Any suggestions? A
recurring definition would be compiled into a set of billing dates.

Recurring definitions might look something like the following:

* Every month for 12 months starting in 1 month

* Every week for 1 week starting in one week then every month for 12 months

* Every month until cancelled starting in one week

3 Answers

lrlebron@gmail.com

1/13/2007 6:21:00 PM

0

You may to look at the chronic library
http://rubyforge.org/projec...

It supports functions similar to what you are looking for.

You can parse things like:

tomorrow
this monday 07:30
may 15th
tomorrow morning
yesterday at 9:00
tomorrow at 11pm
wednesday last week
1 month from now
last friday in January


Luis


snacktime wrote:
> I'm setting about to write a mini language of sorts for defining
> recurring intervals that will be used in a recurring billing
> application. In the past I wrote a simpler version in perl using the
> awsome Date::Manip module, and am looking for the best way to do it in
> ruby. I'm not too concerned about the date calculations themselves
> I'm mainly thinking about how to parse the language. My first thought
> is to just use a parser such as lemon or ragel. Any suggestions? A
> recurring definition would be compiled into a set of billing dates.
>
> Recurring definitions might look something like the following:
>
> * Every month for 12 months starting in 1 month
>
> * Every week for 1 week starting in one week then every month for 12 months
>
> * Every month until cancelled starting in one week

NoSpamAtAll

11/1/2012 4:44:00 PM

0

In article <62i2jb.2iu.17.1@news.alt.net>,
Walt Hampton <walt.hampton@att.net> wrote:

>> But -- don't you deny the Holocaust?

> It is a quote from a previous post, you stupid Yid bastard.

But you answered it as if it was factual, you shit-eating,
piss-drinking, mother-fucking, donkey-dick-sucking inferior
redneck bastard.

Carolina Reb

11/1/2012 4:49:00 PM

0

"NoSpamAtAll" wrote in message news:k6u8sk$5if$1@pcls6.std.com...


>But you answered it as if it
>was factual, you shit-eating,
>piss-drinking, mother-fucking,
>donkey-dick-sucking inferior
>redneck bastard.

Haw! Haw! Haw! Why drop acid when there are plenty
of Yids around....(chuckle!)