Property Lists (*.plist Files)

Property lists are an Apple-specific serialization format:

https://en.wikipedia.org/wiki/Property_list

They come in several formats - XML, binary and a funky "old" / NeXTSTEP custom encoding.

We care about them because launchd's agents are defined in plist files.

All the agent plists I've seen are in XML format, and that's what Loc'd writes and expects to find when reading.

For more info on launchd plists check out:

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html

plists in Ruby

Loc'd uses the plist gem to read and write agent plists:

  1. Plist.parse_xml to parse agent plist XML files to Ruby hashes.

  2. [Plist::Emit.dump][] to encode Ruby hashes into plist XML for writing.

When you see a plist in Loc'd it should be a Ruby hash that was read from an agent plist file and/or created or mutated to be written to an agent plist file (plists are a general data format, but the top-level object in agent plists should always be a dict, which is mapped to a Ruby hash).

The keys of these hashes should all be strings. For details on the possible Ruby value types see

http://www.rubydoc.info/gems/plist#Generation