[MacRuby-devel] gen_bridge_metadata

Larry Wilson lwilson at mac.com
Thu Oct 14 18:58:08 PDT 2010


I've been playing around with the EmbeddedMacRuby project.  

I'd like to be able to:

  a) Run user scripts (written in Ruby) from within a cocoa application (so far, so good)
  b) Call ruby functions from objective-c
  c) Call my private objective-c API's from Ruby functions and scripts

I'm having problems with b & c.

I'm assuming that the mechanism for b & c is different than that used to execute a Ruby script.  It looks like gen_bridge_metadata script should be used to make my objective-c class and methods visible to Ruby.

However, when I try to run gen_bridge_metadata on a simple header file that declares an objective-c class and a couple of test methods, gen_bridge_metadata doesn't produce anything in the output file other than the 3 lines of header information...

  1 <?xml version='1.0'?>
  2 <!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
  3 <signatures version='0.9'/>

I'm running the tool as follows (I've also tried a number of other variations):

	gen_bridge_metadata -c '-I.' MyController.h -o MyController.bridgesupport 

I'm running 10.6.4,   ruby 1.8.7 , with macRuby 0.7 installed.

I also have ruby1.9 installed.

Questions...

1) Shouldn't this produce at least simple output with information regarding the class and method calls?

2) Is there some documentation (or examples) somewhere that shows how to set things up properly to enable items b & c?  I haven't been able to find anything in the documentation, or on the web that actually demonstrates how to do this, and gen_bridge_metadata doesn't seem to be cooperating.

Any pointers or suggestions welcome.


Thanks.

-Larry



More information about the MacRuby-devel mailing list