SVN command not executing correctly through ruby script

Hello,

Im trying to get some code working from the book “Everyday Scripting
with Ruby for Teams, Testers, and You” by Brian M… The code
resides on page 85.

Basically, whats happening is that Im loading this method into irb using
load ‘churn.rb’:

def svn_log(subsystem, start_date)
timespan = “-revision ‘HEAD:{#{start_date}}’”
root = “svn://rubyforge.org//var/svn/churn-demo”

svn log #{timespan} #{root}/#{subsystem}
end

after its loaded, I execute the command:

svn_log(‘persistence’, ‘2005-06-30’)

which should return some SVN(subversion) data. I have subversion
installed.

But instead Im getting a syntax error, which doesnt make sense since i
have spelled everything correctly (triple checked).

Here is the error:

irb(main):002:0> svn_log(‘persistence’, ‘2005-06-30’)
subversion/clients/cmdline/main.c:939: (apr_err=205000)
svn: Syntax error in revision argument ‘evision’
=> “”

After seeing this, Im wondering if the online source even exists. Could
someone please check this for me since Im not the sharpest tool in the
shed when it comes to Subversion just yet.

Also, any advice on how to solve this is greatly appreciated.

Thanks in advance.

I haven’t a clue bout any of this stuff. But your root string looks
funky for a url. Double slash after .org?

timespan = “-revision ‘HEAD:{#{start_date}}’”

According to the svn help output, the flag for revision should either be
a short -r or a long --revision

-Doug

a short -r or a long --revision

That was it. Thanks you very much!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs