ckruse / CFPropertyList

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

Fix for native_types returning Blob data #28

Closed glarizza closed 10 years ago

glarizza commented 10 years ago

Previously, native_types would return an object's decoded_value if it was determined that the object was a CFData type. Because the decoded_value was a String, the native type returned would contain String data instead of CFPropertyList::Blob data. This caused a problem when you tried to convert that native type to a plist - the underlying parser would raise an Encoding error whenever it tried to handle binary data that was in a String format instead of a CFData format.

This commit returns the decoded_value wrapped in a CFPropertyList::Blob declaration, which will return a native type containing an item of CFPropertyList::Blob, instead of type String, which CFPropertyList correctly handles when you try to convert it to a plist.

ckruse commented 10 years ago

Thank you very much

kcrawford commented 10 years ago

Thanks, I just ran into this issue today. Please release a new gem version when you get a chance.

glarizza commented 10 years ago

Shit - I have the test but haven't pushed up and done a PR. Need to remember to do this tomorrow....

On Friday, December 27, 2013, Kyle Crawford wrote:

Thanks, I just ran into this issue today. Please release a new gem version when you get a chance.

— Reply to this email directly or view it on GitHubhttps://github.com/ckruse/CFPropertyList/pull/28#issuecomment-31247483 .

Gary Larizza Professional Services Engineer Puppet Labs

ckruse commented 10 years ago

@kcrawford [x] Done