harvesthq/time-warp — pull request #2 by davedoan (2011-11-07 22:31:49+00:00)
Title: Fix issues with using date library under ruby 1.9.3

Under Ruby 1.9.3, `Date.today` and `DateTime.now` are generated directly from system time instead of using `Time.now`. This caused the methods to return the actual current date/time instead of the time-warp modified ones. I extended the classes to base these methods off of `Time.now`, like they do in 1.9.2.

Instead of cramming all of these extensions in `core_ext.rb`, I placed them all in separate files in a `core_ext` directory.

I had also considered extending these classes to maintain offsets parallel to the `Time` class, but because `Date` doesn't have any time information, creating offsets with a precision of less than one day would be impossible. Always generating from `Time.now` is less than ideal, but I think it's okay if time-warp is only loaded when running tests.