lib/rufus/scheduler.rb in rufus-scheduler-1.0.8 vs lib/rufus/scheduler.rb in rufus-scheduler-1.0.9
- old
+ new
@@ -450,10 +450,22 @@
@exit_when_no_more_jobs = true
join
end
+ #
+ # Ensures that a duration is a expressed as a Float instance.
+ #
+ # duration_to_f("10s")
+ #
+ # will yield 10.0
+ #
+ def duration_to_f (s)
+
+ Rufus.duration_to_f(s)
+ end
+
#--
#
# The scheduling methods
#
#++
@@ -499,10 +511,10 @@
# the job.
#
def schedule_in (duration, params={}, &block)
do_schedule_at(
- Time.new.to_f + Rufus::duration_to_f(duration),
+ Time.new.to_f + Rufus.duration_to_f(duration),
prepare_params(params),
&block)
end
#