nu7hatch/gmail — pull request #82 by ryanlchan (2013-01-28 08:34:23+00:00)
Title: Bugfix: Improperly processing labels containing parentheses

Gmail gem previously considered labels to be processable as flags. However, due to the way Net::IMAP's regexps are constructed, they do not handle parentheses within flag data properly (as described in #81).

This commit creates dedicated functions to process Gmail label data:

* Net::IMAP::ResponseParser#x_gm_labels_data is based on #flags_data, but calls the
new function x_gm_label_list
* Net::IMAP::ResponseParser#x_gm_label_list is based on #flag_list, but uses an
updated regexp which captures strings entirely, including nested parentheses
* String#unescape allows the client to unescape the label names, which are
returned as escaped strings

As of writing, all specs still pass. No specs have been provided for the
unescaping code, as this was pulled from another project and is not core to
Gmail gem.