On Saturday 07 July 2001 08:41, A Bull in the China Shop of Life wrote: > Folks; > > I'm a release engineer and where I work we constantly manage, grow and > otherwise wrangle huge bodies of custom scripts as our development and > release process is quite complex. > > We're moving to Perforce. Solid choice ;-) > So - has anyone done a Perforce interface for Ruby? > > Right now Perforce produces results in either flat text (less than ideal, > hard to parse errors from the results) or as Python 'Marshalled' objects. > > I don't suppose anyone has ever had cause to roll their own Python > compatible object marshalling module for Ruby? :) (sheepish grin). > > Worst case we'll continue to use Python for all our scripts but I figured > I'd ask since having recently begun to learn Ruby I've been smitten by its > elegance and the preponderance of good design decisions it embodies. I'm just starting out with Ruby too, but a Perforce integration is high on my list when I get a chance (I'm also tony / perforce.com ) FWIW, there are at least four ways it could be done: 1. Straight API port. Ruby -> C++ -> Ruby. This is the way the Perl interface to Perforce currently works. So basically you create a class which represents your user interface (derived from e.g. P4ClientUser), and Perforce calls methods on your object with the response from the server. 2. My personal favourite. A ruby class that returns arrays/hashes of results or raises Exceptions as applicable. Similar to 1. but a higher level abstraction. 3. Marshalled output using the Perforce API. I can't see much point in this since the marshalled object would reside in Ruby space anyway, so it might as well be returned rather than marshalled. and lastly... 4. Directly integrated into the p4 command line client in the same way that the Python interface works. This one obviously requires sanction from on high so I can't commit, but I'll look into it - I think option 2 is probably better anyway ( no fork()/exec() ) Do you have a preference? Tony ===================== Tony Smith tony at smee dot org =====================