Forum: Ruby best way for ruby to query subversion

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
72eaded8372821cb46a80b4c77a469cf?d=identicon&s=25 Toby C. (tobycatlin)
on 2006-06-13 16:58
Hello everybody,

I am writing a script to list files that are in a subversion repository.
I am only spiking at the moment but am having trouble.

Basically i want to execute the svn command "svn list
svn://ci.firstconsult.com/fc_codebase" and display what is returned. I
have looked  at using system() but this simply returns true or false
upon execution.

As you can tell i am pretty new to the ruby game but i am sure there is
a simple elegant way of doing this.

thanks for any help

toby
Debd79ae164c1f28ec6cc6b8e2454840?d=identicon&s=25 Bill G. (agorilla)
on 2006-06-13 19:17
(Received via mailing list)
On 6/13/06, Toby Catlin <toby@korfball.com> wrote:
> As you can tell i am pretty new to the ruby game but i am sure there is
> a simple elegant way of doing this.
>
> thanks for any help

To capture the output, use backquotes:
results = `svn list > svn://ci.firstconsult.com/fc_codebase`

Other options explained here:
http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/rub...
John-Mason P. Shackelford (Guest)
on 2006-06-13 19:24
(Received via mailing list)
One option: http://rscm.rubyforge.org/
--
John-Mason Shackelford

Software Developer
Pearson Educational Measurement

2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
john-mason.shackelford@pearson.com
http://pearsonedmeasurement.com
Jeff Rose (Guest)
on 2006-06-16 10:13
(Received via mailing list)
Toby Catlin wrote:
> As you can tell i am pretty new to the ruby game but i am sure there is
> a simple elegant way of doing this.
>
> thanks for any help
>
> toby
>

If you are just listing it might not be worth using the bindings, but I
think newer versions of subversion come with ruby bindings.  (Although
you might need to compile them if it isn't part of the regular build...)
  That will give you a lot more flexibility.  For info on getting the
bindings setup or to see example code checkout the collaboa project.
http://collaboa.org

-Jeff
This topic is locked and can not be replied to.