-
Notifications
You must be signed in to change notification settings - Fork 0
pedro/sheep_cron
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
= Sheep Cron == DESCRIPTION: Sheep Cron, to be confused with "Cheap Cron", is a poor man's cron. It's a pure Ruby alternative for: * Times when cron is not available * People that hates the cron syntax * Fun and profit == USAGE: Scheduling jobs: SheepCron do |job| job.schedule :every => 1.day, :at => '12:00' job.run lambda { Sheep.graze } end # a little more complete job featuring name and exceptions SheepCron do |job| job.name 'Work' job.schedule :every => 1.day, :at => '9am', :except => { |t| t.saturday? || t.sunday? } job.run lambda { Sheep.work } end # jobs can have multiple schedules too SheepCron do |job| job.schedule :every => 1.week, :at => 'friday, 9pm' job.schedule :every => 1.year, :at => '25/12' job.run lambda { Sheep.party! } end == CONFIGURATION: SheepCron.configure do |jobs| jobs.timeout 60.seconds end == INSTALL: gem install sheep_cron == I CAN HAS PATCHES?: * Cron "bridge": accept a crontab to define schedules * Schedule storage backend