lib/fugit/cron.rb in fugit-1.4.1 vs lib/fugit/cron.rb in fugit-1.4.2
- old
+ new
@@ -110,16 +110,11 @@
inc(60 - @t.sec + @cron.seconds.first)
end
end
def dec_month
-
- #dec(@t.day * 24 * 3600 + @t.hour * 3600 + @t.min * 60 + @t.sec + 1)
- #
- # gh-18, so that '0 9 29 feb *' doesn't get skipped (over and over)
- #
- dec(@t.day * 24 * 3600 + 1)
+ dec((@t.day - 1) * 24 * 3600 + @t.hour * 3600 + @t.min * 60 + @t.sec + 1)
end
def dec_day
dec(@t.hour * 3600 + @t.min * 60 + @t.sec + 1)
end
@@ -778,11 +773,15 @@
[ s, z ]
end
def rewrite_cron(t)
- hcron = t
+ st = t
.sublookup(nil) # go to :ccron or :scron
+
+ return nil unless st
+
+ hcron = st
.subgather(nil) # list min, hou, mon, ...
.inject({}) { |h, tt|
h[tt.name] = tt.name == :tz ? rewrite_tz(tt) : rewrite_entry(tt)
h }