rack_dav 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack_dav/controller.rb +1 -1
- data/lib/rack_dav/version.rb +1 -1
- data/rack_dav.gemspec +1 -1
- data/spec/controller_spec.rb +1 -7
- data/spec/handler_spec.rb +11 -12
- data/test.sh +3 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07a0acafcd6edfa26067ea7fa81aeefaad2aa5a32c902f5d23ee507851960837
|
4
|
+
data.tar.gz: 00dccec097d8f05b042f6178197a8d68f6b4d97582da890d2abc5151a6412757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36086650caeb7b3f48cbd9c7516a3c6412a96c6aaaeceeadbaaf10d1973b843a09dd23eca58e19d3137bf347d44ea07beb44583fba68209eea454923d67e8257
|
7
|
+
data.tar.gz: 68f1fffd5aca502ad75481037f8d2df715fb26b42200cba5631eec2f42cdd9f38b94189238d4d1a92da8bc74b249479c510dd04751dc37babb814a03cb49b130
|
data/lib/rack_dav/controller.rb
CHANGED
@@ -401,7 +401,7 @@ module RackDAV
|
|
401
401
|
end.to_xml
|
402
402
|
response.body = [content]
|
403
403
|
response["Content-Type"] = 'text/xml; charset=utf-8'
|
404
|
-
response["Content-Length"] =
|
404
|
+
response["Content-Length"] = content.to_s.bytesize.to_s
|
405
405
|
end
|
406
406
|
|
407
407
|
def multistatus
|
data/lib/rack_dav/version.rb
CHANGED
data/rack_dav.gemspec
CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency('nokogiri', "~> 1.5")
|
24
24
|
s.add_dependency('webrick', "~> 1.3")
|
25
25
|
s.add_dependency('puma', "~> 6.0")
|
26
|
-
s.add_development_dependency("rspec", "~>
|
26
|
+
s.add_development_dependency("rspec", "~> 3.4.0")
|
27
27
|
s.add_development_dependency("rake","~> 13.0")
|
28
28
|
end
|
data/spec/controller_spec.rb
CHANGED
@@ -26,12 +26,6 @@ class Rack::MockResponse
|
|
26
26
|
|
27
27
|
end
|
28
28
|
|
29
|
-
if ENV['TRAVIS']
|
30
|
-
RSpec.configure do |c|
|
31
|
-
c.filter_run_excluding :has_xattr_support => true
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
29
|
describe RackDAV::Handler do
|
36
30
|
|
37
31
|
DOC_ROOT = File.expand_path(File.dirname(__FILE__) + '/htdocs')
|
@@ -77,7 +71,7 @@ describe RackDAV::Handler do
|
|
77
71
|
end
|
78
72
|
|
79
73
|
it "sets a compliant rack response" do
|
80
|
-
body = response.original_response
|
74
|
+
body = response.original_response
|
81
75
|
body.should be_a(Array)
|
82
76
|
expect(body.size).to eq(1)
|
83
77
|
end
|
data/spec/handler_spec.rb
CHANGED
@@ -1,18 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RackDAV::Handler do
|
4
|
+
let(:handler) { RackDAV::Handler.new }
|
5
|
+
let(:request) { Rack::Request.new({ 'REQUEST_METHOD' => 'GET' }) }
|
4
6
|
|
5
7
|
describe "#initialize" do
|
6
8
|
it "accepts zero parameters" do
|
7
9
|
lambda do
|
8
|
-
|
9
|
-
end.should_not raise_error
|
10
|
-
end
|
11
|
-
|
12
|
-
it "accepts a hash of options" do
|
13
|
-
lambda do
|
14
|
-
klass.new({})
|
15
|
-
klass.new :foo => "bar"
|
10
|
+
handler
|
16
11
|
end.should_not raise_error
|
17
12
|
end
|
18
13
|
|
@@ -22,16 +17,20 @@ describe RackDAV::Handler do
|
|
22
17
|
end
|
23
18
|
|
24
19
|
it "defaults option :resource_class to FileResource" do
|
25
|
-
|
26
|
-
instance.options[:resource_class].should be(RackDAV::FileResource)
|
20
|
+
handler.options[:resource_class].should be(RackDAV::FileResource)
|
27
21
|
end
|
28
22
|
|
29
23
|
it "defaults option :root to current directory" do
|
30
|
-
path =
|
24
|
+
path = '/tmp'
|
31
25
|
Dir.chdir(path)
|
32
|
-
instance =
|
26
|
+
instance = handler
|
33
27
|
instance.options[:root].should == path
|
34
28
|
end
|
29
|
+
|
30
|
+
it 'sets the response status to 405 if the request method is not allowed' do
|
31
|
+
request.env['REQUEST_METHOD'] = 'FOO'
|
32
|
+
expect(handler.call(request.env)[0]).to eq(405)
|
33
|
+
end
|
35
34
|
end
|
36
35
|
|
37
36
|
end
|
data/test.sh
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack_dav
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Georgi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 3.4.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 3.4.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- spec/handler_spec.rb
|
156
156
|
- spec/spec_helper.rb
|
157
157
|
- spec/support/lockable_file_resource.rb
|
158
|
+
- test.sh
|
158
159
|
homepage: http://georgi.github.com/rack_dav
|
159
160
|
licenses:
|
160
161
|
- MIT
|