summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.rdoc1
-rw-r--r--README.rdoc17
2 files changed, 18 insertions, 0 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
index 57618f0..efe0157 100644
--- a/CHANGELOG.rdoc
+++ b/CHANGELOG.rdoc
@@ -5,6 +5,7 @@
https://github.com/patsplat/plist/compare/v3.3.0...HEAD
* Your contribution here!
+* Support custom indent string (https://github.com/patsplat/plist/pull/44)
=== 3.3.0 (2017-04-28)
diff --git a/README.rdoc b/README.rdoc
index 5803a39..220c45a 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -112,6 +112,23 @@ When you attempt to serialize a +MyFancyString+ object, the +to_plist_node+ meth
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
[Rubygems] https://rubygems.org/gems/plist