railsdav 0.1.1 → 0.1.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
- SHA1:
3
- metadata.gz: dd5f799717de2365ef03eff7ea9ec0bb586c6fcc
4
- data.tar.gz: '09d15fd87f739ae2f185eaf7131b7e812f8cfbb0'
2
+ SHA256:
3
+ metadata.gz: 771b1048a14bc88f28879e83c5493c6bc3d7f0a60b24f5e24700682119ad35cc
4
+ data.tar.gz: b35736f2cf7fe41cfd49b153c57a20fdf681db43c9329a18ff747eaee36d7f98
5
5
  SHA512:
6
- metadata.gz: 710fb87af393f354e0cd6a96551532cbc96551cd69a6ab4105af315deebd2ed0bfb25f525ff5cd2ffdc4d222fb715575dbe198d2f1f0bdc8e08875f875c2b3e1
7
- data.tar.gz: 5fb4db899de9270e8c6b0bbcffd088c9501b5a5b87ebadb07fdfcf44e006dbdc3baab0ec4396bfc16868580ea6144ed1edc3af2e1485d2ee2944439df12f7eb6
6
+ metadata.gz: 05545b0fcd291c23fc9b7d6ebb571ccae3b555c0f21e88738532562e765a7d805f93c8e073dc4362605e08924cc03a47cb889261b3df696c1df92b32595d8051
7
+ data.tar.gz: ba25ad0b328f6458351bf66efc10b93a4c7760676e6d9205c364ae5022e23ce65186555f9503ef58d9c22c90c4ba264c3ccff6ddab9b140d507f74121258a9bf
data/README.md CHANGED
@@ -182,6 +182,7 @@ is_webdav_request? checks whether an Incoming request is issued by a WebDAV clie
182
182
 
183
183
  ## Changelog
184
184
 
185
+ * 0.1.2: Rails 5.0 compatibility
185
186
  * 0.1.1: NoMethodError fix if using `format.any` responder
186
187
  * 0.1.0: Rails 4.2 compatibility
187
188
  * 0.0.9: Add missing file to gemspec
@@ -4,11 +4,37 @@ module Railsdav
4
4
  module ControllerExtensions
5
5
  extend ActiveSupport::Concern
6
6
 
7
+ # ruby 2+ compatibility
8
+ module RespondWithWebdav
9
+ # decorate behaviour defined in ActionController::MimeResponds
10
+ def respond_to(*mimes, &block)
11
+ if request.propfind?
12
+ render :webdav => :propstat, :respond_to_block => block
13
+ else
14
+ super *mimes, &block
15
+ end
16
+ end
17
+
18
+ # decorate behaviour defined in ActionController::MimeResponds
19
+ def respond_with(*resources, &block)
20
+ if request.propfind?
21
+ render :webdav => :propstat, :respond_to_block => block
22
+ else
23
+ super *resources, &block
24
+ end
25
+ end
26
+
27
+ end
28
+
7
29
  included do
8
30
  class_attribute :webdav_metadata
9
31
 
10
- alias_method_chain :respond_to, :webdav
11
- alias_method_chain :respond_with, :webdav
32
+ if respond_to? :prepend # ruby >= 2.0
33
+ prepend RespondWithWebdav
34
+ elsif respond_to? :alias_method_chain # ruby < 2.0
35
+ alias_method_chain :respond_to, :webdav
36
+ alias_method_chain :respond_with, :webdav
37
+ end
12
38
  end
13
39
 
14
40
  module ClassMethods
@@ -24,7 +24,7 @@ class ActionDispatch::Routing::Mapper
24
24
  case Rails.version
25
25
  when /^3\./
26
26
  map_method(method_name, *args, &block)
27
- when /^4\./
27
+ when /^(4|5)\./
28
28
  map_method(method_name, args, &block)
29
29
  else
30
30
  raise "Your Rails Version (#{Rails.version}) is currently not supported by the RailsDAV gem."
@@ -199,8 +199,12 @@ class ActionDispatch::Routing::Mapper
199
199
 
200
200
  if Rails.version < '3.2'
201
201
  resource_scope(WebDAVResource.new(resources.pop, options), &sub_block)
202
- else
202
+ elsif Rails.version < '5.0'
203
203
  resource_scope(:webdav_resources, WebDAVResource.new(resources.pop, options), &sub_block)
204
+ else
205
+ with_scope_level :webdav_resources do
206
+ resource_scope WebDAVResource.new(resources.pop, api_only?, options), &sub_block
207
+ end
204
208
  end
205
209
 
206
210
  self
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsdav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Kerkhof
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Provides basic Rails 3/Rails 4 extensions for making your business resources
13
+ description: Provides basic Rails 3/4/5 extensions for making your business resources
14
14
  accessible via WebDAV. This gem does by no means by no means implement the full
15
15
  WebDAV semantics, but it suffices to access your app with client(-libs) such as
16
16
  Konqueror, cadaver, davfs2 or NetDrive
@@ -49,8 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  version: '0'
50
50
  requirements: []
51
51
  rubyforge_project:
52
- rubygems_version: 2.5.2
52
+ rubygems_version: 2.7.6
53
53
  signing_key:
54
54
  specification_version: 4
55
- summary: Make your Rails 3/4 resources accessible via WebDAV
55
+ summary: Make your Rails 3/4/5 resources accessible via WebDAV
56
56
  test_files: []