Module: Sinatra::WebDAV

Defined in:
lib/sinatra/webdav.rb

Overview

Sinatra::WebDAV

This extensions provides WebDAV verbs, as defined by RFC 4918 (tools.ietf.org/html/rfc4918). To use this in your app, just register it:

require 'sinatra/base'
require 'sinatra/webdav'

class Application < Sinatra::Base
  register Sinatra::WebDAV

  # Now you can use any WebDAV verb:
  propfind '/2014/january/21' do
    'I have a lunch at 9 PM'
  end
end

You can use it in classic application just by requiring the extension:

require 'sinatra'
require 'sinatra/webdav'

mkcol '/2015' do
  'You started 2015!'
end

Defined Under Namespace

Modules: Request

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.registered(_) ⇒ Object



34
35
36
# File 'lib/sinatra/webdav.rb', line 34

def self.registered(_)
  Sinatra::Request.include WebDAV::Request
end

Instance Method Details

#copy(path, opts = {}, &bk) ⇒ Object



86
# File 'lib/sinatra/webdav.rb', line 86

def copy(path, opts = {}, &bk)      route 'COPY',      path, opts, &bk end

#mkcol(path, opts = {}, &bk) ⇒ Object



85
# File 'lib/sinatra/webdav.rb', line 85

def mkcol(path, opts = {}, &bk)     route 'MKCOL',     path, opts, &bk end

#move(path, opts = {}, &bk) ⇒ Object



87
# File 'lib/sinatra/webdav.rb', line 87

def move(path, opts = {}, &bk)      route 'MOVE',      path, opts, &bk end

#propfind(path, opts = {}, &bk) ⇒ Object



83
# File 'lib/sinatra/webdav.rb', line 83

def propfind(path, opts = {}, &bk)  route 'PROPFIND',  path, opts, &bk end

#proppatch(path, opts = {}, &bk) ⇒ Object



84
# File 'lib/sinatra/webdav.rb', line 84

def proppatch(path, opts = {}, &bk) route 'PROPPATCH', path, opts, &bk end

#unlock(path, opts = {}, &bk) ⇒ Object

def lock(path, opts = {}, &bk) route ‘LOCK’, path, opts, &bk end



89
# File 'lib/sinatra/webdav.rb', line 89

def unlock(path, opts = {}, &bk)    route 'UNLOCK',    path, opts, &bk end