GPGTools/Libmacgpg — pull request #19 by idodeclare (2012-05-27 18:27:26+00:00)
Title: GPGWatcher can now watch .conf and raise a new notification

Hello.

This is a contribution to get GPGWatcher watching gpg.conf and
gpg-agent.conf, with GPGOptions using the new notification to
cause a re-read from files.

This way, a running GPGMail, GPGPreferences, or GPGKeychainAccess
will know to reload configuration when one of the others writes
a new setting (or if some other script or editor does).

There is a UnitTest for the new GPGWatcher behavior.

Also, this pulls in the updated pinentry dep. (GPGTools_Core too).

Changes:

- new GPGConfigurationModifiedNotification raised by GPGWatcher

- GPGOptions observes new notification to manage its gpgConf
and gpgAgentConf instances

- add to GPGOptions keyPathsForValuesAffectingValueForKey: for
underlying "gpgConf" and "gpgAgentConf" as appropriate so that
the change cascades to KV observers

- GPGWatcher can now detect file creation too

- reduced the window of time where fs events are dropped for
GPGWatcher. still a 5 second lag but now a 2 second window (1.0
toleranceBefore/1.0 after)

- GPGOptions synchronizes gpgConf and gpgAgentConf properties.
I can think of at least one background thread which accesses
GPGOptions: GPGServices' new ServiceWorker.

unit testing:

- test GPGConfigurationModifiedNotification (borrowed event loop
test from github user n-b's public gist)

- modified GPGWatcher singleton implementation to be
unit-testable. now a "relaxed" singleton capable of making
separate instances.

- GPGOptions now properly deallocs to unregister its notifications
(really for unit testing)