views:

140

answers:

2

I'm hoping to integrate Mercurial into my Rails site. I want to run basic commands like status, summary, log, and maybe even clone. I'd like to interface directly with the Mercurial libraries and avoid doing any command line parsing via regex.

Mercurial is written in Python; I am using Ruby. So, I need Mercurial Ruby bindings. It seems, however, that there are none. So, plan B would be to go with something like Ruby/Python (http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html; an extension library to embed the Python interpreter in Ruby) or rubypython (http://rubypython.rubyforge.org/; a C bridge between Ruby and Python with a Ruby interface).

Do you all see any reason why one of these libraries won't provide me what I am wanting?

Does anyone have any alternative ideas?

+1  A: 

I would look at the redmine code, and do whatever they do.

mikerobi
Thanks for the comment. They actually use command-line parsing.
Chad Johnson
+1  A: 

So, I need Mercurial Ruby bindings. It seems, however, that there are none.

You are right. But there is something even better than a Ruby binding to the Python Mercurial implementation: a Ruby (plus little bits of C) Mercurial implementation!

Jörg W Mittag
oo. I saw this, but I didn't realize that's what this is. Hmm. Should I use it though? I'm afraid of it becoming unsupported or not being kept up to date.
Chad Johnson