ckruse / CFPropertyList

Read, write and manipulate both binary and XML property lists as defined by apple
MIT License
212 stars 47 forks source link

Hash to Pretty XML not working? #22

Closed dayglojesus closed 11 years ago

dayglojesus commented 11 years ago

Should the following not produce pretty XML?

As per: http://projects.puppetlabs.com/issues/21530

require 'rubygems'
require 'cfpropertylist'

foo = { :foo => "foo", :bar => "bar", :baz => "baz" }

puts foo.to_plist({:plist_format => CFPropertyList::List::FORMAT_XML, :formatted => true})
dayglojesus commented 11 years ago

Looks like the :formatted param is not being passed:

rbREXMLParser.rb, Line 420:

plist.to_str(options[:plist_format])

Quick fix is:

plist.to_str(options[:plist_format], options)
ckruse commented 11 years ago

You are right, there were several bugs. I added more tests and fixed the bugs.

ckruse commented 11 years ago

See https://github.com/ckruse/CFPropertyList/compare/97e074fd8b...6ef1299222

ckruse commented 11 years ago

And thanks for the bug report!

dayglojesus commented 11 years ago

Awesome. Thanks, Christian.