This post originated from an RSS feed registered with Web Buzz
by Matthias Georgi.
Original Post: RackDAV - Web Authoring for Rack
Feed Title: Matthias Georgi
Feed URL: http://feeds.feedburner.com/matthias-georgi?format=xml
Feed Description: Webdev, Gamedev and Interaction Design.
RackDAV is Handler for Rack, which allows content authoring over
HTTP. RackDAV brings its own file backend, but other backends are
possible by subclassing RackDAV::Resource.
Install
Just install the gem from github:
$ gem sources -a http://gems.github.com
$ sudo gem install georgi-rack_dav
Quickstart
If you just want to share a folder over WebDAV, you can just start a
simple server with:
$ rack_dav
This will start a WEBrick server on port 3000, which you can connect
to without authentication.
Rack Handler
Using RackDAV inside a rack application is quite easy. A simple rackup
script looks like this:
require 'rubygems'
require 'rack_dav'
use Rack::CommonLogger
run RackDAV::Handler.new('/path/to/docs')
Implementing your own WebDAV resource
RackDAV::Resource is an abstract base class and defines an interface
for accessing resources.
Each resource will be initialized with a path, which should be used to
find the real resource.
RackDAV::Handler needs to be initialized with the actual resource class: