ckruse / CFPropertyList

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

Create a CFPropertyList::Blob data type #17

Closed glarizza closed 11 years ago

glarizza commented 11 years ago

Previously, String#blob was being monkey patched to account for the differences between a regular String and a CFData binary data blob. This wasn't ideal as monkey patching String can cause difficulties tracking down errors.

To remedy this, a new data type, CFPropertyList::Data, was introduced to
differentiate between regular String objects and objects that contain raw
binary data.
glarizza commented 11 years ago

Just a couple of comments:

I'm open for discussion!

ckruse commented 11 years ago

Hm, there seems to be a bug in rbCFTypes.rb… I have to have a closer look at it.

ckruse commented 11 years ago

about the DATA_RAW: this flag only determines, what the incoming data is. If you create a new CFData segment with Base64 input, you have to specify DATA_BASE64, otherwise specify DATA_RAW. It has nothing to do with the encoding, how data is encoded in plists is defined by the plist standard: base64 in XML and raw in plist.

ckruse commented 11 years ago

Hehe, the test fails because your input data is corrupted ;-) Try to open it with the PList editor. I fixed it in upstream

ckruse commented 11 years ago

Ok, everything seems to work. Can you confirm? I would release a new version

glarizza commented 11 years ago

Pulled down and all tests pass for me! Thanks for the insight and correcting the issue!

ckruse commented 11 years ago

Fine, I released a new version :-)