# Subversion wrapper in Ruby

**URL:** <https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028>\
**Category:** Ruby\
**Created:** [April 3, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028 "2007-04-03T22:28:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 3, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/1 "2007-04-03T22:28:15Z")

</div>

I’ve begun developing a small library that wraps the command-line  
Subversion commands, so that you can call SVN.copy(src, dest, :message  
=\> ‘chunky bacon’) etc. These will only cover the methods Subversion  
directly supports.

The reason I’m making this library is actually that I want to have Rake  
tasks that automate tagging, branching, etc. of my repository.  
Currently, the most advanced thing I have is this:

SVN::TagReleaseTask.new do |t|  
t.repository = ‘svn://svn.example.org/bacon’  
t.version = ‘1.2.3’  
end

Calling `rake svn:tag:release’ will then issue the following to the  
command line:

svn copy svn://svn.example.org/bacon/trunk  
svn://svn.example.org/bacon/tags/release-1.2.3 --message “tagging  
release 1.2.3”

Do you have any special wishes? As soon as the Rubyforge submission goes  
through I’ll make an alpha gem for those wanting to get their hands  
dirty 🙂

Cheers,  
Daniel

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 4, 2007, 10:22am UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/2 "2007-04-04T10:22:48Z")

</div>

On Wed, Apr 04, 2007 at 05:26:12AM +0900, Daniel S. wrote:

> ```
> t.repository = 'svn://svn.example.org/bacon'
> t.version = '1.2.3'
> 
> ```
> 
> end
> 
> Calling `rake svn:tag:release’ will then issue the following to the  
> command line:
> 
> svn copy svn://svn.example.org/bacon/trunk  
> svn://svn.example.org/bacon/tags/release-1.2.3 --message “tagging  
> release 1.2.3”

As an aside: there are direct Ruby bindings into the underlying libsvn,  
so  
it’s possible to talk to a SVN repository directly (local or remote)  
without  
spawning an external command.

Unfortunately libsvn doesn’t seem to be well documented, especially for  
remote access. A couple of interesting posts are here:

> **[Agylen Blog Photographi](http://agylen.com/)**

[http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/](http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/)

So you’re probably right to use the command-line interface.

Regards,

Brian.

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 4, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/3 "2007-04-04T12:57:14Z")

</div>

Wow, I hope you will follow through and stay active. Many people don’t  
even  
get past the coding part.

I think this will be neat. I already developed a script that  
automatically  
add .rb files, but it take me several tries and lot of example code. I  
hope  
this library you’re developing will ease the process of writing SVN ruby  
scripts.

I don’t really have anything special to wish for, except an easy to use  
API.

Wish you all the best luck in the world.

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 4, 2007, 1:02pm UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/4 "2007-04-04T13:02:14Z")

</div>

On 4/3/07, Daniel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve begun developing a small library that wraps the command-line  
> Subversion commands, so that you can call SVN.copy(src, dest, :message  
> =\> ‘chunky bacon’) etc. These will only cover the methods Subversion  
> directly supports.

See also RSCM, [http://rscm.rubyforge.org/](http://rscm.rubyforge.org/) which looks interesting.

Alex

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 10, 2007, 1:09am UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/5 "2007-04-10T01:09:08Z")

</div>

On Wed, 2007-04-04 at 19:55 +0900, Han D. wrote:

> Wish you all the best luck in the world.

Thank you very much! I’m really just adding some convenience methods –  
most of the work goes into the Rake tasks.

Cheers,  
Daniel

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [April 11, 2007, 10:28am UTC](https://www.ruby-forum.com/t/subversion-wrapper-in-ruby/91028/6 "2007-04-11T10:28:14Z")

</div>

On Tuesday 03 April 2007 20:26, Daniel S. wrote:

> ```
> t.repository = 'svn://svn.example.org/bacon'
> 
> ```
> 
> Do you have any special wishes? As soon as the Rubyforge submission goes  
> through I’ll make an alpha gem for those wanting to get their hands  
> dirty 🙂
> 
> Cheers,  
> Daniel

well i can only wish you good luck - svn support is much needed - from  
me i  
can paste code that i found on wiki somewhere and modified a little - it  
adds/deletes all changed files in directory to SVN.
