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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f5efaaf9d78cffb9459cce4b8ff84610ae9a480303d23e0266cbd8ec351603b
4
- data.tar.gz: 817e1db4fcb91c2fa26e8be1e32074c466c8aa6c7631237b73bd9e61c6316804
3
+ metadata.gz: 07a0acafcd6edfa26067ea7fa81aeefaad2aa5a32c902f5d23ee507851960837
4
+ data.tar.gz: 00dccec097d8f05b042f6178197a8d68f6b4d97582da890d2abc5151a6412757
5
5
  SHA512:
6
- metadata.gz: b827c9616a9c8a106bdd0bb2dce19e944f9a21932f0686b6ce51a58307094c88d449e1673d611769c1dce28e1fdb460770eeff4351b235aa30718bf7d0cad665
7
- data.tar.gz: 33c156ccecb968a88d8d38435b9d95a65245de4abce448dc0d987f83cf5f355ec4289c823be5340bf5e333bcf99622bd908be9f9dee1fafab79e82cd0cf21289
6
+ metadata.gz: 36086650caeb7b3f48cbd9c7516a3c6412a96c6aaaeceeadbaaf10d1973b843a09dd23eca58e19d3137bf347d44ea07beb44583fba68209eea454923d67e8257
7
+ data.tar.gz: 68f1fffd5aca502ad75481037f8d2df715fb26b42200cba5631eec2f42cdd9f38b94189238d4d1a92da8bc74b249479c510dd04751dc37babb814a03cb49b130
@@ -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"] = Rack::Utils.bytesize(content).to_s
404
+ response["Content-Length"] = content.to_s.bytesize.to_s
405
405
  end
406
406
 
407
407
  def multistatus
@@ -4,7 +4,7 @@ module RackDAV
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 5
7
- PATCH = 1
7
+ PATCH = 2
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
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", "~> 2.11")
26
+ s.add_development_dependency("rspec", "~> 3.4.0")
27
27
  s.add_development_dependency("rake","~> 13.0")
28
28
  end
@@ -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.body
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
- klass.new
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
- instance = klass.new
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 = File.expand_path("../../bin", __FILE__)
24
+ path = '/tmp'
31
25
  Dir.chdir(path)
32
- instance = klass.new
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
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ docker build -t rackdav . && docker run -it rackdav rspec
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.1
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-06 00:00:00.000000000 Z
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: '2.11'
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: '2.11'
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