Archive for the ‘svn’ Category

111

Monday, August 14th, 2006

I just noticed one of our svn repos is on rev 111.

*Paul lifts his feet from the floor till the next commit*

Packaging Edge Rails as a Gem?

Thursday, August 3rd, 2006

Does anyone have a clue as to how to download Edge Rails and package it as a Gem for easy install? Right now I have my svn repo setup with an external link to Edge Rails but ideally I’d like to be able to create a gem from Edge Rails and install that. Any help is appreciated.

Getting the SVN revision number in Ruby

Friday, July 28th, 2006

rev = `svn info`.match('Revision: (\d+)')[1]

That bit of Ruby code will return the Subversion revision number of the working copy it is run in.

`svn info` returns

Path: .
URL: http://svn.yourdomain.com/trunk/

Repository UUID: 4e38b711-8f0e-1410-9e15-e3a330ac0d60
Revision: 894
Node Kind: directory
Schedule: normal
Last Changed Author: pwatson
Last Changed Rev: 894
Last Changed Date: 2006-07-28 14:48:28 +0100 (Fri, 28 Jul 2006)
Properties Last Updated: 2006-07-28 14:50:11 +0100 (Fri, 28 Jul 2006)

The regex bit (.match(’Revision: (\d+)’)[1]) then returns the 894 number from that string.

(Thanks to Dela for the regex.)