GPGTools/Libmacgpg — pull request #1 by idodeclare (2012-02-27 20:38:57+00:00)
Title: Add GPGStdSetting and subclasses to represent options from .conf

Hello! Here is my first contribution. I tackled the problem for the ticket I submitted:

http://gpgtools.lighthouseapp.com/projects/66966-gpgpreferences/tickets/39

I waited to start until after the hack marathon to see if the team managed to get to it. Please I would love to hear your feedback.

- GPGConf uses GPGStdSetting instances as its contents, instead of
directly NSNumber, NSString, NSArray, etc.

- GPGStdSetting and its subclasses manage a value as well as
associated comments

- GPGConf can now round-trip a .conf when no changes are made

- when settings are changed, associated comments as well as the
ordering of the settings is preserved in .conf

- GPGStdSetting and its subclasses subsume the previous value types
(NSNumber, NSArray, etc.), so the GPGConf API for valueForKey:
and setValue:forKey: is unchanged and compatible with previous
usage.

- add unit tests for new functionality, and existing unit tests
test backward compatibility

- GPGStdSetting represents either a boolean or a string value

- GPGLinesSetting represents an array that spans lines in .conf
(e.g., "comment GPGTools - http://gpgtools.org")

- GPGArraySetting represents parameters on one line (e.g.,
"list-options show-photos, show-notations")

- GPGDictSetting handles the NSDictionary

- can handle special treatment for options -- e.g.,
"keyserver-options" is GPGDictSetting; "auto-key-locate" is
GPGArraySetting; "no-auto-key-locate" is not the inverse of
"auto-key-locate"

- now properly handles multiple delimiters in .conf -- parameters
can be space- or comma-delimited, and contiguous delimiters are
collapsed as per GPG documentation