rufus-scheduler 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/rufus/sc/jobs.rb CHANGED
@@ -201,6 +201,13 @@ module Scheduler
201
201
 
202
202
  @at = Rufus.at_to_f(@t)
203
203
  end
204
+
205
+ # Returns the next time (or the unique time) this job is meant to trigger
206
+ #
207
+ def next_time
208
+
209
+ Time.at(@at)
210
+ end
204
211
  end
205
212
 
206
213
  #
@@ -327,6 +334,13 @@ module Scheduler
327
334
  trigger(time) if @cron_line.matches?(time)
328
335
  end
329
336
 
337
+ # Returns the next time this job is meant to trigger
338
+ #
339
+ def next_time (from=Time.now)
340
+
341
+ @cron_line.next_time(from)
342
+ end
343
+
330
344
  protected
331
345
 
332
346
  def determine_at
@@ -33,7 +33,7 @@ module Rufus::Scheduler
33
33
 
34
34
  # This gem's version
35
35
  #
36
- VERSION = '2.0.0'
36
+ VERSION = '2.0.1'
37
37
 
38
38
  #
39
39
  # It's OK to pass an object responding to :trigger when scheduling a job
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux