CFPropertyList implementation class to read, manipulate and write both XML and binary property list files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List for more documentation.
In version 3.0.0 we dropped Ruby 1.8 compatibility. If you are using Ruby 1.8 consider to update Ruby; if you can't upgrade, don't upgrade CFPropertyList.
You could either use ruby gems and install it via
gem install CFPropertyList
or you could clone this repository and place it somewhere in your load path.
Example:
require 'cfpropertylist'
If you're using Rails, you can add it into your Gemfile
gem 'CFPropertyList'
data = {
'name' => 'John Doe',
'missing' => true,
'last_seen' => Time.now,
'friends' => ['Jane Doe','Julian Doe'],
'likes' => {
'me' => false
}
}
plist = CFPropertyList::List.new
plist.value = CFPropertyList.guess(data)
plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)
plist = CFPropertyList::List.new(:file => "example.plist")
data = CFPropertyList.native_types(plist.value)
Author: Christian Kruse (mailto:[email protected])
Copyright: Copyright (c) 2010
License: MIT License