Showing posts with label rss. Show all posts
Showing posts with label rss. Show all posts

Monday, May 5, 2008

Re: RSS Feeds for Subversion

I was reading a friend's blog post about RSS feeds for Subversion repositories earlier... he couldn't find anything that was not written in a scripting language which he has no access to in his environment... he needed a Java based solution.  He solved his problem with a war.  I came back to this after dinner (and a few glasses of wine) and decided to show him another way to solve this problem on the JVM... (you knew it was coming Matt.)

Assuming you already have JRuby setup (of course you do), we'll do the following to get the one gem we'll need:
[sourcecode language="css"]
> jruby -S gem install rscm
[/sourcecode]

The RSCM (Ruby Source Code Management) gem provides a nice interface to SVN, CVS, ClearCase, StarTeam, etc. and since it's written in pure Ruby, it runs just fine on the JVM.

Then download this file. Not much to it, 106 lines and 45 of that is the template for creating the rss xml doc.

Command line has a few options, here's an example:
[sourcecode language="css"]
> jruby -J-server server.rb -p 8080 -m svnlog
or just get help
> jruby server --help

-p, --port=3003 Which port do you want the server to listen on.
-m, --mount-point=svnrss http:///
-h, --help Show help (this).
[/sourcecode]

Point your RSS reader @ the following: http://localhost:8080/svnlog?url=http://svn.codehaus.org/jruby/trunk/&num_revs=15 and here's what you get:

SVN RSS Feed


(Firefox 3 beta)


Nice, think I'll actually use this.