README.rdoc in rufus-scheduler-2.0.8 vs README.rdoc in rufus-scheduler-2.0.9
- old
+ new
@@ -20,11 +20,11 @@
* http://github.com/hpoydar/chronic_duration
== installation
- sudo gem install rufus-scheduler --source http://gemcutter.org
+ gem install rufus-scheduler
== usage
The usage is similar to the one of the old rufus-scheduler. There are a few differences though.
@@ -93,11 +93,17 @@
The timezones are the ones supported by the 'tzinfo' rubygem (http://tzinfo.rubyforge.org/).
The timezone support was contributed by Tanzeeb Khalili.
+Since 2.0.9, "monthdays" are supported
+ scheduler.cron '0 22 * * sun#1,sun#2' do
+ # every first and second sunday of the month, at 22:00
+ end
+
+
== scheduler.join
Note that if you have a tiny script like this one :
require 'rubygems'; require 'rufus-scheduler'
@@ -164,11 +170,11 @@
end
scheduler.in '21m' do
puts "order espresso"
end
-Hence, our espresso wil come in 22 minutes instead of 21.
+Hence, our espresso will come in 22 minutes instead of 21.
== 'every' jobs and :first_at / :first_in
This job will execute every 3 days, but first time will be in 5 days from now :
@@ -188,9 +194,11 @@
require 'chronic' # sudo gem install chronic
scheduler.every '3h', :first_at => Chronic.parse('this tuesday 5:00') do
# do something starting this tueday
end
+
+Note : setting a :first_at/:first_in in the past will get rufus-scheduler to trigger for all the past schedules until now. Adding :discard_past => true will prevent this.
== self unschedule for 'cron' and 'every' jobs
'at' and 'in' jobs fire once only. 'cron' and 'every' jobs do fire repeatedly, so it might be useful to stop them.