Class: DAV4Rack::BuildResource
- Inherits:
-
FileResource
- Object
- FileResource
- DAV4Rack::BuildResource
- Defined in:
- lib/dav4rack/build_resource.rb
Instance Method Summary collapse
- #copy(*args) ⇒ Object
- #delete(*args) ⇒ Object
-
#get(request, response) ⇒ Object
TODO: This is a workaround of Rack bug Fix is in master which is incompatible with current Rails (facepalm) github.com/rack/rack/commit/7c36a88f73339bebe8b91b27e47ac958a7965f4f.
- #make_collection ⇒ Object
- #move(*args) ⇒ Object
- #put(*args) ⇒ Object
Instance Method Details
#copy(*args) ⇒ Object
39 40 41 |
# File 'lib/dav4rack/build_resource.rb', line 39 def copy(*args) raise HTTPStatus::Forbidden end |
#delete(*args) ⇒ Object
35 36 37 |
# File 'lib/dav4rack/build_resource.rb', line 35 def delete(*args) raise HTTPStatus::Forbidden end |
#get(request, response) ⇒ Object
TODO: This is a workaround of Rack bug Fix is in master which is incompatible with current Rails (facepalm) github.com/rack/rack/commit/7c36a88f73339bebe8b91b27e47ac958a7965f4f
The whole method should be removed as soon as new Rack is released
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dav4rack/build_resource.rb', line 12 def get(request, response) return super unless stat.directory? response.body = "" rack_directory = Rack::Directory.new(root).call(request.env)[2] rack_directory.files.map do |x| x[0].gsub! /^#{Regexp.escape('%2Fbuilds')}/, '/builds' x end rack_directory.each do |line| response.body << line end response['Content-Length'] = response.body.bytesize.to_s OK end |
#make_collection ⇒ Object
47 48 49 |
# File 'lib/dav4rack/build_resource.rb', line 47 def make_collection raise HTTPStatus::Forbidden end |
#move(*args) ⇒ Object
43 44 45 |
# File 'lib/dav4rack/build_resource.rb', line 43 def move(*args) raise HTTPStatus::Forbidden end |
#put(*args) ⇒ Object
31 32 33 |
# File 'lib/dav4rack/build_resource.rb', line 31 def put(*args) raise HTTPStatus::Forbidden end |