summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYen-Nan Lin <yennanlin.tw@gmail.com>2017-08-22 16:41:49 +0800
committerYen-Nan Lin <yennanlin.tw@gmail.com>2017-08-22 16:41:49 +0800
commit923dd1ce5d6859abe123d4b847620f8c1e5bfe7e (patch)
tree3a21836fb630ac92605cd494ba3d8a77956ef767
parent0a44713c1d6575aa4d6021349a4a3f277a3038da (diff)
downloadplist-923dd1ce5d6859abe123d4b847620f8c1e5bfe7e.tar.gz
Add description of support custom indent to Changelog and README
-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