lib/fugit/cron.rb in fugit-1.10.1 vs lib/fugit/cron.rb in fugit-1.11.0
- old
+ new
@@ -262,10 +262,12 @@
"too many loops for #{@original.inspect} #next_time, breaking, " +
"cron expression most likely invalid (Feb 30th like?), " +
"please fill an issue at https://git.io/fjJC9"
) if (i += 1) > MAX_ITERATION_COUNT
+#tt = t.time;
+#puts " #{tt.strftime('%F %T %:z %A')} #{tt.rweek} #{tt.rweek % 2}"
(ifrom == t.to_i) && (t.inc(1); next)
month_match?(t) || (t.inc_month; next)
day_match?(t) || (t.inc_day; next)
hour_match?(t) || (t.inc_hour; next)
min_match?(t) || (t.inc_min; next)
@@ -305,10 +307,12 @@
"too many loops for #{@original.inspect} #previous_time, breaking, " +
"cron expression most likely invalid (Feb 30th like?), " +
"please fill an issue at https://git.io/fjJCQ"
) if (i += 1) > MAX_ITERATION_COUNT
+#tt = t.time;
+#puts " #{tt.strftime('%F %T %:z %A')} #{tt.rweek} #{tt.rweek % 4}"
month_match?(t) || (t.dec_month; next)
day_match?(t) || (t.dec_day; next)
hour_match?(t) || (t.dec_hour; next)
min_match?(t) || (t.dec_min; next)
sec_match?(t) || (t.dec_sec; next)
@@ -563,10 +567,13 @@
def expand(min, max, r)
sta, edn, sla = r
- return false if sla && sla > max
+ #return false if sla && sla > max
+ #
+ # let it go, "* */24 * * *" and "* */27 * * *" are okay
+ # gh-86 and gh-103
edn = max if sla && edn.nil?
return nil if sta.nil? && edn.nil? && sla.nil?
return sta if sta && edn.nil?