WEBrick+WebDAV Handler Safely Extracted From the Wild #
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:
#!/usr/bin/ruby 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 } serv.start
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.
MenTaLguY
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?
Aredridel
Oh, that’s wonderful!
pate
great stuff!
So how do we start the hunt for other gems hiding out in the wild?
aemadrid
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
Jo
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)!
milano
Can the WebDAV tool also be used with the Unix web servers www.lighttpd.net or www.acme.com/software/thttpd/ ?
Jo
Two more Ruby tool websites you might have overlooked so far: rubystuff.org and ncurses-ruby.berlios.de !
mikee
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.