In response to a ML post time.next_week bug? and related to tickets 2353, 2509, 4551, the attached patch causes Time#since to be aware of dst? changes and adjust the result accordingly if the requested delta was 86400 (1.day) or more.
It would be better if the semantics were better defined for sub-day or non-integral-days deltas, but the behavior will be closer to what many expect for things like:
Time.local(2005,10,30).since(1.day) => Mon Oct 31 00:00:00 EST 2005
Unfortunately, I don't think it right to give this knowledge of DST to the Numeric extension so the unexpected behavior of:
1.day.since(Time.local(2005,10,30)) => Sun Oct 30 23:00:00 EST 2005
remains.
Comments on better semantics for <1.day changes or on Numeric#since acquiring this instead are welcomed. (As the Time#since delegated to Numeric#since which just lets the Time class handle the change in seconds, it seems like a coin flip, but I could accept that either the changes belong in Numeric or that Numeric ought to delegate to Time to restore the symmetry.)
-Rob