# Best way for ruby to query subversion

**URL:** <https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257>\
**Category:** Ruby\
**Created:** [June 13, 2006, 4:58pm UTC](https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257 "2006-06-13T16:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobycatlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tobycatlin](https://www.ruby-forum.com/u/tobycatlin)\
**Post date:** [June 13, 2006, 4:58pm UTC](https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257/1 "2006-06-13T16:58:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tobycatlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tobycatlin](https://www.ruby-forum.com/u/tobycatlin)\
**Post date:** [June 13, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257/2 "2006-06-13T19:17:45Z")

</div>

On 6/13/06, Toby C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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/ruby/ruby-talk/191009?190859-192450](http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/191009?190859-192450)

---

<div class="post-metadata">

**Author:** ![tobycatlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tobycatlin](https://www.ruby-forum.com/u/tobycatlin)\
**Post date:** [June 13, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257/3 "2006-06-13T19:24:22Z")

</div>

## One option: [http://rscm.rubyforge.org/](http://rscm.rubyforge.org/)

John-Mason Shackelford

Software Developer  
Pearson Educational Measurement

2510 North Dodge St.  
Iowa City, IA 52245  
ph. 319-354-9200x6214  
removed\_email\_address@domain.invalid  
[http://pearsonedmeasurement.com](http://pearsonedmeasurement.com)

---

<div class="post-metadata">

**Author:** ![tobycatlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tobycatlin](https://www.ruby-forum.com/u/tobycatlin)\
**Post date:** [June 16, 2006, 10:13am UTC](https://www.ruby-forum.com/t/best-way-for-ruby-to-query-subversion/63257/4 "2006-06-16T10:13:54Z")

</div>

Toby C. 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](http://collaboa.org)

-Jeff
