hoodwink.d enhanced


WEBrick+WebDAV Handler Safely Extracted From the Wild #

by why in inspect

Adrian Madrid originally found this Ruby app called Sarada and posted it to del.icio.us. Sure enough, Tatsuki Sugiura is hiding all these great wares in his darcs repository, including a WebDAV handler for WEBrick! Uhm, let’s get this good candidate for the core distribution dusted off.

If you want to try it out, I’ve got a gem up: gem install webrick-webdav.

Here’s a sample WebDAV server, written by Sugiura:

 require 'rubygems'
 require 'webrick'
 require 'webrick/httpservlet/webdavhandler'

 log = WEBrick::Log.new
 log.level = WEBrick::Log::DEBUG if $DEBUG
 serv = WEBrick::HTTPServer.new({:Port => 10080, :Logger => log})
 serv.mount("/", WEBrick::HTTPServlet::WebDAVHandler, Dir.pwd)
 trap(:INT){ serv.shutdown }

I tested with cadaver localhost:10080 and listing, moving, removing, editing, putting, getting files is all there. There’s a buffer size message at the top of the source code mentioning trouble with large files, but I was able to transfer eight megs with no trouble at all. I think the comment refers to a bugfix the author made. Holy cats!

Keep in mind: it requires iconv due to the compatibility the handler tries to ensure among Konqueror, gnome-vfs, Windows, etc.

said on 25 Jul 2005 at 17:24

It makes you wonder.

What other gems-in-hiding lurk in the dark recesses of public SCMs?

Can we harness these powers for the good, the better, or the awesome?

said on 25 Jul 2005 at 21:33

Oh, that’s wonderful!

said on 26 Jul 2005 at 10:41

great stuff!

So how do we start the hunt for other gems hiding out in the wild?

said on 26 Jul 2005 at 14:14

Good to find my name out there! I’ve been looking for a while for a Ruby webdav server and just googling found it. Wish I knew japanese, though. Looks like there is a lot of treasures to be found if I knew some japanese.

Adrian Madrid

said on 05 Aug 2005 at 04:03

Some Ruby gems I’ve come across as of late: amrita.sourceforge.jp (a HTML template engine; the website is in English!); rmagick.rubyforge.org; ruby-session (just Google for it); www.rubycolor.org/arc/ (some interesting Ruby scripts); and purepistos.net/diakonos (a console-based text editor)!

said on 05 Aug 2005 at 04:29

Can the WebDAV tool also be used with the Unix web servers www.lighttpd.net or www.acme.com/software/thttpd/ ?

said on 10 Aug 2005 at 01:43

Two more Ruby tool websites you might have overlooked so far: rubystuff.org and ncurses-ruby.berlios.de !

said on 10 Aug 2005 at 14:36

Scientist & engineers should see the Ruby wrapper for the GNU Scientific Library (for calculating matrixes, etc.): ruby-gsl.sourceforge.net

Comments are closed for this entry.