README.rdoc in plist-3.3.0 vs README.rdoc in plist-3.4.0
- old
+ new
@@ -5,13 +5,18 @@
Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
== Usage
+=== Security considerations
+
+Plist.parse_xml uses Marshal.load for <data/> attributes. If the <data/> attribute contains malicious data, an attacker can gain code execution.
+You should never use Plist.parse_xml with untrusted plists!
+
=== Parsing
- result = Plist::parse_xml('path/to/example.plist')
+ result = Plist.parse_xml('path/to/example.plist')
result.class
=> Hash
"#{result['FirstName']} #{result['LastName']}"
@@ -110,26 +115,44 @@
When you attempt to serialize a +MyFancyString+ object, the +to_plist_node+ method will be called and the object's contents will be defancified and placed in the plist.
If for whatever reason you can't add this method, your object will be serialized with <tt>Marshal.dump</tt> instead.
+==== Custom indent
+
+You can customize the default indent foramt (default format is tab) or specify the indent format on each serialization. For example, if you want to reduce size of plist output, you can set the indent to <tt>nil</tt>.
+
+An example to change default indent format:
+
+ Plist::Emit::DEFAULT_INDENT = nil
+
+An example to specify indent format on dump:
+
+ Plist::Emit.dump({:foo => :bar}, false)
+ => "<dict>\n\t<key>foo</key>\n\t<string>bar</string>\n</dict>\n"
+
+ Plist::Emit.dump({:foo => :bar}, false, :indent => nil)
+ => "<dict>\n<key>foo</key>\n<string>bar</string>\n</dict>\n"
+
+
== Links
-[Project Page] http://plist.rubyforge.org
-[GitHub] http://github.com/bleything/plist
-[RDoc] http://plist.rubyforge.org
+[Rubygems] https://rubygems.org/gems/plist
+[GitHub] https://github.com/bleything/plist
+[RDoc] http://www.rubydoc.info/gems/plist
== Credits
-plist is maintained by Ben Bleything <mailto:ben@bleything.net> and Patrick May <mailto:patrick@hexane.org>. Patrick wrote most of the code; Ben is a recent addition to the project, having merged in his plist generation library.
+plist was authored by Ben Bleything <mailto:ben@bleything.net> and Patrick May <mailto:patrick@hexane.org>. Patrick wrote most of the code; Ben contributed his plist generation library. The project is currently maintained by @mattbrictson[https://github.com/mattbrictson].
Other folks who have helped along the way:
[<b>Martin Dittus</b>] who pointed out that +Time+ wasn't enough for plist <tt>Dates</tt>, especially those in <tt>~/Library/Cookies/Cookies.plist</tt>
[<b>Chuck Remes</b>] who pushed Patrick towards implementing <tt>#to_plist</tt>
[<b>Mat Schaffer</b>] who supplied code and test cases for <tt><data></tt> elements
[<b>Michael Granger</b>] for encouragement and help
[<b>Carsten Bormann, Chris Hoffman, Dana Contreras, Hongli Lai, Johan Sørensen</b>] for contributing Ruby 1.9.x compatibility fixes
+And thank you to all of the other GitHub contributors[https://github.com/patsplat/plist/graphs/contributors] not mentioned here!
== License and Copyright
plist is released under the MIT License.