From: "M. Edward (Ed) Borasky" Date: 2006-09-21T22:55:37+09:00 Subject: Re: Assistance wanted for integrating existing C-API into Ruby Feurio wrote: > Hello, > > I am seeking assistance for writing a ruby wrapper for the c-api of an > existing enterprise system. This job is a paid job. > > > In my vision the access from ruby/rails to this existing system should > be like working with active record. > Basically I think there should be a ruby layer to make the c-api > accessible and another that integrates it with Active Record. I think > this makes sense because my main focus is to access the data of the > enterprise system. > > > For the first layer I can imagine to use SWIG (this seems to be a good > way to integrate a c-api from ruby; but if you know a better way just > tell me) and for the second part one has to write an active record > adapter. > > > So I am searching someone who has the experience and knowledge to get > such a job done (at least the part to create the ruby wrapper around > the c-api). The first step would be to create a working prototype > within the next two months. > > Feurio > > > I'm not looking for a paid job, but I've had a little experience with Ruby and SWIG. For pure C code, it's pretty much a matter of downloading and installing the latest SWIG (development status, but very high quality, excellent docs and a very friendly developer team), and then writing a "module" file for each C function you want to wrap. C++ is much different -- you need to know a lot more about what the code you want to wrap is doing. But the SWIG manual has a very well written section on the details of the Ruby/C++ interface. One other note: SWIG tries very hard to generate portable wrappers. That is, if you have a "module" descriptor, you can interface your C functions to Perl, Python, PHP, Lua and Tcl in addition to Ruby. If at all possible, don't do anything that locks you into Ruby or locks you out of other scripting languages. You never know when someone is going to come along and "ask" you to support their "favorite" scripting language.