Hi,

In <39258fa0705041423xd0f7a23hfdcd7c86344d1731 / mail.gmail.com>
  "Re: Subversion Ruby Bindings access to URL" on Sat, 5 May 2007 06:23:56 +0900,
  "Jacob Burkhart" <igotimac / gmail.com> wrote:

> require 'svn/client'
> require 'svn/ra'
> 
> url = '___'
> 
> ctx = Svn::Client::Context.new
> 
> cb = Svn::Ra::Callbacks.new(ctx.auth_baton)
> 
> provider = Proc.new do
>   |cred, realm, default, may_save, pool|
> 
>   simplecreds = Svn::Ext::Core::Svn_auth_cred_simple_t.new
>   simplecreds.username = "___"
>   simplecreds.password = "___"
> 
>   simplecreds
> end
> 
> cb.auth_baton = Svn::Core.auth_open(
>   [
>     Svn::Client::get_simple_prompt_provider(provider, 2)
>     ])
> 
> cfg = Svn::Core::config_get_config(nil)
> 
> s = Svn::Ra::Session.open(url, cfg, cb)
> 
> st = s.stat('', 1)
> 
> puts <<EOS
> Status of node(#{url})
> created revision = #{st.created_rev}
> committed time = #{Time.at(st.time / 1_000_000)}
> author = #{st.last_author}
> size = #{st.size}
> EOS

require 'svn/client'

url = '___'

ctx = Svn::Client::Context.new
ctx.add_simple_prompt_provider(2) do |cred, realm, user_name, may_save|
  cred.username = "___"
  cred.password = "___"
end

ctx.info(url) do |path, info|
  puts <<EOS
Status of node(#{info.url})
created revision = #{info.last_changed_rev}
committed time = #{Time.from_apr_time(info.last_changed_date)}
author = #{info.last_changed_author}
EOS
end

Test cases of the Ruby bindings for Subversion may help you:
  https://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/ruby/test/


> Now that I've figured out how to connect... I realize that the
> Svn::Client interface and the Svn::Repos APIS are completely
> different... and my original goal of making Retrospectiva work or
> remote repositories is looking a lot bleaker.

Svn::Client interface is similar to svn command interface.


Thanks,
--
kou