A couple of fixes for cfstr_to_str() #43

Merged
merged 2 commits into from Jan 7, 2013

Projects

None yet

3 participants

@ferrous26
Contributor

I was reviewing your code and found some simple fixes.

ferrous26 added some commits Dec 29, 2012
@ferrous26 ferrous26 Avoid a redundant allocation in cfstr_to_str bd1a5e8
@ferrous26 ferrous26 Fix CFDataRef memory leak in cfstr_to_str()
Memory is created with a "Create" method, so the
function owns it and needs to release it.
4ae1f11
Owner
alloy commented Jan 7, 2013

Awesome, thanks!

I was thinking, you suggested to copy MacRuby’s code into this repo, but how about we create a unified version of all the code and move it out of this repo into a CoreFoundation based gem that does nothing but (de)serialize plists? That should help us both out.

@alloy alloy merged commit 954b782 into CocoaPods:master Jan 7, 2013

1 check passed

default The Travis build passed
Details
Owner

👍

I was tanking into account solutions for simplifying the installation of CocoaPods and the compilation of the native extension appears to be a major pain point. Does the MacRuby code handle the old plist format? What about using something like plutil to ensure that a plist is in the new format?

Contributor

@alloy A shared project would be great, but I think the overhead of having to bridge all the core types is a lot of if the gem is only going to work with plists.

The issue for me is that I need a lot of bridging code (too much) in my project. I've actually already got 95% of what I need done in https://github.com/AXElements/accessibility_core/blob/master/ext/accessibility/bridge/bridge.h, though I would have to clean it up if were to be shared.

Perhaps the better solution is to have a shared git submodule (or something like that), with some code that builds a dylib that we can link against. The dylib would only contain functions for bridging objects

@irrationalfab I'm not sure I understand the problem you are describing. Are you looking to build CocoaPods as a binary distribution, sort of like Vagrant or Tokaido? When I suggested copying some code from MacRuby, I meant only https://github.com/MacRuby/MacRuby/blob/master/objc.m#L741-756, which is not much, but it translated into my bridging code fairly easily https://github.com/AXElements/accessibility_core/blob/master/ext/accessibility/extras/extras.c#L447-468

It could be changed to take an optional argument with the style of plist. Same thing with Object#to_plist. I would then also have to propose/make those changes in MacRuby, but that should be almost trivial if the bridging code remains similar.

Owner

@ferrous26 Thanks for pointing out where the source was located, I was naively searching among the ruby files. Actually now I see that MacRuby is using Foundation as well, so this pull was not the best place to discuss those ideas.

Are you looking to build CocoaPods as a binary distribution, sort of like Vagrant or Tokaido?

Yes, I'm interested in simplifying the installation of CocoaPods (avoid the need to install command line tools on a Mac) and in having a binary distribution as with a bundled Ruby. For the latter I have done some progress (https://github.com/irrationalfab/Ikeda) but it is more a working hack for now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment