cantino/reckon — pull request #32 by purcell (2014-01-25 15:21:46+00:00)
Title: Make date formats explicit

See #18.

Took me a while to get around to this, but here's some initial code for your consideration.

With these changes, if `--date-format` is not supplied, all parsed dates are assumed to be US-style. Aliases are provided for some other types, e.g. `--date-format=chase`, `--date-format=guess` (to use Chronic). Failure to strictly match the expected date format now results in a `CSVParser::ParseError`, so `reckon` will now be more finicky to run, but can be trusted to not mangle dates. Files containing mixed date formats will no longer work, but I believe this is not likely to be an issue in the vast majority of places.

In order to test the failure case, I've stopped the `CSVParser` from calling `exit` deep in the call stack, but I'm not (yet) doing anything to suppress the resulting backtrace at the app level. I'll do that if you think this PR is otherwise sound.