-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes date-time format, and adds decode_datetime #66
Conversation
Looking at https://rubygems.org/gems/date/reverse_dependencies, it looks like there aren't any very large/popular gems with a dependency on |
b81dc9e
to
bc30109
Compare
`Net::IMAP.format_datetime` was previously using an incorrect `date-time` format (see the `Net::IMAP::STRFDATE` rdoc). I don't know if anyone actually *uses* `format_datetime`, but fixing the bug isn't backwards compatible. I implemented the correct behavior under a different method name (and an alias). The existing method keeps its original behavior (for now), with a warning that it will be fixed in a future version. Also: * adds "date" gem as a dependency * adds `{format,parse}_date` methods. * updates `send_data` * adds `Date` handling. This can be used by `SEARCH`. * uses `encode_datetime` from `send_time_data` (reduces duplication) * adds aliases * `format_*` => `encode_*` * `parse_*` => `decode_*` * `encode_time` => `encode_datetime` * but `decode_time` returns a Time object
bc30109
to
bcd1f4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK to add date.gem as a dependency.
There is a major issue with I install Ruby from distro packages and then a set of pure Ruby gems but net-imap is no longer pure. |
This modifies the code I added in ruby#66 to make it more useful when `date-time` is parsed as a `quoted` string (as it currently is). I'd prefer that `date-time` values were simply parsed as DateTime objects in the ResponseParser, but that has backwards compatibility issues.
This modifies the code added in ruby#66 to make it more useful when `date-time` is parsed as a `quoted` string (as it currently is). I'd prefer that ResponseParser simply parse `date-time` values as DateTime objects, but that has backwards compatibility issues.
This modifies the code added in ruby#66 to make it more useful when `date-time` is parsed as a `quoted` string (as it currently is). I'd prefer that ResponseParser simply parse `date-time` values as DateTime objects, but that has backwards compatibility issues.
Fixes date-time format, and adds decode_datetime.
Also:
send_data
. This will be used by search.I don't know if anyone is actually using Net::IMAP.format_datetime. If they are, then fixing the bug will not be backwards compatible. Since "encode" and "decode" are a natural pair (and we already had "encode_utf7"), I added new methods with those names and added deprecation warnings to the old methods.