lib/fugit/cron.rb in fugit-1.3.8 vs lib/fugit/cron.rb in fugit-1.3.9
- old
+ new
@@ -234,10 +234,12 @@
t = TimeCursor.new(self, from.translate(@timezone))
#
# the translation occurs in the timezone of
# this Fugit::Cron instance
+ zfrom = t.time.strftime('%z|%Z')
+
loop do
fail RuntimeError.new(
"too many loops for #{@original.inspect} #next_time, breaking, " +
"cron expression most likely invalid (Feb 30th like?), " +
@@ -249,11 +251,17 @@
day_match?(t) || (t.inc_day; next)
hour_match?(t) || (t.inc_hour; next)
min_match?(t) || (t.inc_min; next)
sec_match?(t) || (t.inc_sec; next)
- st = t.time.strftime('%F|%T')
- (from, sfrom, ifrom = t.time, st, t.to_i; next) if st == sfrom
+ tt = t.time
+ st = tt.strftime('%F|%T')
+ zt = tt.strftime('%z|%Z')
+ #
+ if st == sfrom && zt != zfrom
+ from, sfrom, zfrom, ifrom = tt, st, zt, t.to_i
+ next
+ end
#
# when transitioning out of DST, this prevents #next_time from
# yielding the same literal time twice in a row, see gh-6
break