Re: [MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-04 Thread Matt Aimonetti
Avec plaisir, feel free to share the result of your work once you're done :) - Matt On Thu, Nov 4, 2010 at 7:19 PM, Julien Jassaud wrote: > Matt, Laurent, > > Thanks for pointing me to this very obvious mistake ! It works perfectly > now. > > Julien > > Le 5 nov. 2010 à 05:23, Laurent Sansonett

Re: [MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-04 Thread Julien Jassaud
Matt, Laurent, Thanks for pointing me to this very obvious mistake ! It works perfectly now. Julien Le 5 nov. 2010 à 05:23, Laurent Sansonetti a écrit : > Salut Julien, > > Looks like you forgot to set the value of the pointer. > CGPDFContextCreateWithURL() was therefore called with a pointer

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Laurent Sansonetti
Excellent, thanks. I just looked and we appear to honor the DYLD_FRAMEWORK_PATH environment variable already, but there is probably a bug somewhere. I will have a look later. Thanks for reporting the problem :) Laurent On Nov 4, 2010, at 1:31 PM, Louis-Philippe wrote: > while I was replying t

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Louis-Philippe
while I was replying to the ticket comment ;) so: my use case is one of TDD, where the framework is not installed but in the build folder. Even if I: ENV['DYLD_FRAMEWORK_PATH'] = ENV['BUILT_PRODUCTS_DIR'] the framework doesn't load properly. > > ___ Ma

Re: [MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-04 Thread Laurent Sansonetti
Salut Julien, Looks like you forgot to set the value of the pointer. CGPDFContextCreateWithURL() was therefore called with a pointer to a zero rect. Try this: page_rectangle = NSMakeRect(0,0,100,100) page_rectangle_pointer = Pointer.new_with_type(NSRect.type)# Using

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Laurent Sansonetti
Hi Louis-Philippe, I replied to the bug but I'm not sure if comments are propagated to your e-mail address. In short, where did you install ObjCHiredis.framework in your system? Laurent On Nov 4, 2010, at 12:23 PM, Louis-Philippe wrote: > ok! > done! > Thanks! > > 2010/11/4 Eloy Duran > Yep

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Louis-Philippe
ok! done! Thanks! 2010/11/4 Eloy Duran > Yep, that's a bug. Can you file a ticket? Thanks :) > > On 4 nov 2010, at 19:44, Louis-Philippe wrote: > > Thanks Eloy! > I was starting to poke myself, trying to wakeup from a bad dream... > and your answer helped me to get it right: > > what works: > >

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Eloy Duran
Actually I can't reproduce that either: I've copied the framework into the load path at: /Library/Frameworks/ObjCHiredis.framework % macirb irb(main):001:0> framework 'ObjCHiredis' => true irb(main):002:0> r = ObjCHiredis.alloc.init => # irb(main):003:0> r.connect('127.0.0.1', on:1234) 2010-11-0

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Eloy Duran
Yep, that's a bug. Can you file a ticket? Thanks :) On 4 nov 2010, at 19:44, Louis-Philippe wrote: > Thanks Eloy! > I was starting to poke myself, trying to wakeup from a bad dream... > and your answer helped me to get it right: > > what works: > > >> framework 'ObjCHiredis.framework' > => true

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Louis-Philippe
Thanks Eloy! I was starting to poke myself, trying to wakeup from a bad dream... and your answer helped me to get it right: what works: >> framework 'ObjCHiredis.framework' => true >> redis = ObjCHiredis.alloc.init => # >> redis.connect("127.0.0.1", on:6379) => 1 what doesn't: >> framework 'Obj

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Eloy Duran
Oops, forgot to paste the result: % macirb irb(main):001:0> framework '/Users/eloy/Documents/DEVELOPMENT/MacRuby/ObjCHiredis/ObjCHiredis/build/Debug/ObjCHiredis.framework' => true irb(main):002:0> redis = ObjCHiredis.alloc.init => # irb(main):003:0> redis.connect("127.0.0.1", on:6379) 2010-11-04

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Eloy Duran
Works for me on a recent trunk version. Which version are you on? Otherwise try trunk or a nightly build. Eloy On 4 nov 2010, at 17:44, Louis-Philippe wrote: > There are no non OO structure at all, at least I think... One public Objc > class with 4 methods total. Thats it. > > and by the wa

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Louis-Philippe
There are no non OO structure at all, at least I think... One public Objc class with 4 methods total. Thats it. and by the way, methods from foundation framework work: >> framework "foundation" => true >> base = NSURL.URLWithString("/usr/local/bin") => # >> myurl = NSURL.URLWithString("myapp/pr

Re: [MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Matt Aimonetti
I'm not really sure what's going on there and to be honest, I didn't check your code, but did you try to generate a BridgeSupport file to expose non OO structures? - Matt On Thu, Nov 4, 2010 at 9:05 AM, Louis-Philippe wrote: > Hi all, > > I have a funny problem, > I have a framework I created,

Re: [MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-04 Thread Matt Aimonetti
Salut Julien, I'm not really sure what's wrong with the pointer you are passing, but here is how I got your code sample to work: framework 'Cocoa' path = CFStringCreateWithCString(nil, "./my_pdf.pdf", KCFStringEncodingUTF8) url = CFURLCreateWithFileSystemPath(nil, path, KCFURLPOSIXPathStyle, 0)

[MacRuby-devel] MacRuby methods with external frameworks

2010-11-04 Thread Louis-Philippe
Hi all, I have a funny problem, I have a framework I created, ObjCHiredis , which works with MacRuby. Except I can't use methods with more than one arguments in it??? like: ObjCHiredis.redis works fine but ObjCHiredis.redis("127.0.0.1", on:6379) doesn't. ??? I

[MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-04 Thread Julien Jassaud
Hello to every one, I am trying to programmatically create a pdf. I have this quite simple code in Cocoa that works perfectly : #import #import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; CGContextRef pdfContext; CFStringRef