[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Google Summer of Code] Subversion servlet for WEBrick

From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2007-03-20 17:31:59 CET

Hi Ben,

Thank you for quick answer.

From: "Ben Collins-Sussman"
Subject: Re: [Google Summer of Code] Subversion servlet for WEBrick
Date: Tue, 20 Mar 2007 10:37:03 -0500

> On 3/20/07, Kobayashi Noritada <nori1@dolphin.c.u-tokyo.ac.jp> wrote:
>
> > I'd like to propose developing a Subversion servlet for WEBrick [...]
> >
> > My idea is to add a Subversion servlet for WEBrick, which can
> > ease using Subversion from programs (in particular, web applications)
> > written in Ruby. [...]
>
> After reading your email a few times, I still don't undestand what a
> 'subversion servlet' for WEBrick would actually do. All you say is

Hmm..., I must have explained how WEBrick works.

WEBrick works with servlets which determine what they do when accessed
by clients. A servlet is implemented as an instance of a subclass of
WEBrick::HTTPServlet::AbstractServlet. http://www.webrick.org/ has
some examples of servlets and here is one (sorry, this is an example
far from Subversion):

[[[
#!/usr/local/bin/ruby
require 'webrick'
include WEBrick

s = HTTPServer.new( :Port => 2000 )

# HTTPServer#mount(path, servletclass)
# When a request referring "/hello" is received,
# the HTTPServer get an instance of servletclass
# and then call a method named do_"a HTTP method".

class HelloServlet < HTTPServlet::AbstractServlet
  def do_GET(req, res)
    res.body = "<HTML>hello, world.</HTML>"
    res['Content-Type'] = "text/html"
  end
end
s.mount("/hello", HelloServlet)

# HTTPServer#mount_proc(path){|req, res| ...}
# You can mount also a block by `mount_proc'.
# This block is called when GET or POST.

s.mount_proc("/hello/again"){|req, res|
  res.body = "<HTML>hello (again)</HTML>"
  res['Content-Type'] = "text/html"
}

trap("INT"){ s.shutdown }
s.start
]]]

> 'subversion servlet' for WEBrick would actually do. All you say is
> 'ease using subversion from ruby web applications'. What does that
> mean? How would a ruby webapp "use" subversion? Can you give a
> concrete example?

This was another future story: story on creating a plug-in for Ruby on
Rails that use the servlet. Only creating the servlet cannot do the
job. Sorry for my wrong explanation... If Subversion servlet for
WEBrick is available and the plugin also available, other webapp can
use that plug-in and the servlet to access Subversion. However, as
Malcolm says, this story is too big and must not be included in the
proposal.

-nori

  • application/pgp-signature attachment: stored
Received on Tue Mar 20 17:32:31 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.