tags:

views:

130

answers:

3

I've done very little work with Ruby, and have an app I've written in PHP. I would like to add some functionality which is available in open sourced Ruby code.

I could either try to translate the Ruby to PHP, or try mixing the two. Though I think the mixing part would be somewhat silly.

I believe my options are to either mix ruby with php, or translate the ruby code into php.

Anybody have any suggestions on this, or other ideas? I am not really interested in converting my entire app into Ruby just so I can get this feature (I saw Derek Sivers post about that which convinced me. http://www.oreillynet.com/ruby/blog/2007/09/7%5Freasons%5Fi%5Fswitched%5Fback%5Fto%5Fp%5F1.html)

A: 

May be you can turn the Rails part to REST API and use it gradually with PHP, though honestly there is no one reason to turn back from Ruby to PHP....

khelll
A: 

A more interesting (read: difficult) way to do it would be to use jRuby http://www.jruby.org/ and Quercus on a java server http://www.caucho.com/resin-3.0/quercus/

SeanJA
A: 

I'm not very familiar with PHP, but one approach might be to write a shell script in Ruby and call that from PHP. Another, if you don't need the Ruby code to be executed in the HTTP request-response cycle, would be to set up a Ruby daemon and communicate with that via a messaging protocol such as AMQP.

Greg Campbell