periodicity¶ ↑
DESCRIPTION:¶ ↑
Helps calculate the next run for schedulers using a human readable syntax.
SYNOPSIS:¶ ↑
period = Period.new(Time.now).every(2).hours.at(20).from(10).to(15)
means: every 2 hours at :20 from 10:00 to 15:00 (10:20, 12:20, 14:20)
period.next_run # returns the next calculated time as a Time object Period.new.every(:half).hour # every 30 minutes Period.new.every.week # every week Period.new.every(5).seconds # every 5 seconds
REQUIREMENTS:¶ ↑
-
active support (not sure about the exact version yet)
INSTALL:¶ ↑
-
gem sources -a gems.github.com
-
sudo gem install vrinek-periodicity
TODO:¶ ↑
-
add something like “every minute from 20:00 to 21:00 and from 02:00 to 03:00”