From: Bob Aman Date: 2005-04-12T10:43:22+09:00 Subject: Re: Accessing SVN through Ruby (Cross-posting to dev@subversion.tigris.org since at least part of this message is probably better answered by them. Apologies to the respective mailing lists for the parts that are off topic.) > Is DL unsuitable for this? That would require only a compiled SVN > library. DL? > svn lists easily parseable output as one of its features... I don't think calling out to the command line client is a truely viable option. Ideally, I need a reliable interface to Subversion for Ruby. I want to be able to easily wrap it with something more "ruby-like" than the raw API. Ideally, I need to be able to "checkout" to memory - I probably don't have the luxury of checking stuff out to disk. The ultimate purpose is something almost like ViewSVN or WebSVN, except that I need to, at the very least, be able to modify the metadata from within the web app. And we're probably talking about around 50-100 concurrent users, not just one person at a time. It needs to be cross-platform. It needs to be somewhat easy, because I am not a C hacker by any stretch of the imagination. And it's got to be reasonably simple to set up on Windows, since, for the moment, that's the dev environment I'm stuck with. I've been trying to get the Ruby SWIG bindings to work, but I have absolutely no idea how to get SWIG to do its thing. It just sits there and complains about missing files. -- E:\Ruby Projects\Libraries\ruby-svn\swig>swig svn_client.i apr.i(47): Error: Unable to find 'apr.h' svn_types.i(527): Error: Unable to find 'svn_types.h' svn_delta.i(91): Error: Unable to find 'svn_delta.h' svn_wc.i(116): Error: Unable to find 'svn_wc.h' svn_client.i(434): Error: Unable to find 'svn_client.h' -- Of course, it doesn't help that building svn on Windows seems to require superhuman effort, though it's quite possible that I'm just missing some build step somewhere. But for me to actually do what I want, this thing needs to all get packaged up in a gem. (http://docs.rubygems.org/read/book/1) Thus far, I've gotten the impression that even if I were to get this whole SWIG thing to work, the steps required to get there might be too difficult for rubygems to handle compiling from source. Which seems to leave me with precompiled gems? I don't know, I'm kinda fuzzy on this. I want this as the end result: gem install ruby-svn *poof, magic ensues* And I want that magic to ensue regardless of what platform I'm running on. If the user doesn't have subversion installed, I don't want that to be a problem. I want the only prerequisite to be ruby and rubygems. That includes build tools. If the user lacks SWIG or vc++ or whatever, I don't want that to prevent the library from working. I think that leaves me with binaries, but... It looked like the fxruby library did some stuff with SWIG and managed to pull it off fairly well, but I'm not sure I want users of the library to be presented with a list of 10 possible versions for different platforms when they type gem install ruby-svn like what happens with fxruby. Especially when one of those platforms is "ruby". Sooooo.... what happens with fxruby if I'm on Windows and I select "ruby" as my platform instead of "win32"? "ruby" doesn't make sense as an option, so ideally, I'd rather just have the end result work everywhere instead of confusing the user with nonsensical choices that I don't have much control over. Also, I don't want to be dealing with bleeding edge stuff from Subversion's svn repository. I have to make the corporate overlords happy, and you all know how that goes. So... is there any way for me to access the subversion client library without doing any SWIG magic, or at the very least, doing the SWIG magic ahead of time and then including any necessary binaries for the various platforms within a single gem? And if I'm absolutely stuck doing SWIG magic, can someone hold my hand and walk me through getting that to work in Windows? I've been trying to do this for almost a week now, and I'm really no further than when I first started. -- Bob Aman