railsdav 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -0
- data/lib/railsdav/controller_extensions.rb +28 -2
- data/lib/railsdav/routing_extensions.rb +6 -2
- metadata +5 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 771b1048a14bc88f28879e83c5493c6bc3d7f0a60b24f5e24700682119ad35cc
         | 
| 4 | 
            +
              data.tar.gz: b35736f2cf7fe41cfd49b153c57a20fdf681db43c9329a18ff747eaee36d7f98
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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 | 
            -
                   | 
| 11 | 
            -
             | 
| 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 | 
            -
                   | 
| 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. | 
| 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:  | 
| 11 | 
            +
            date: 2018-04-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 | 
            -
            description: Provides basic Rails 3/ | 
| 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. | 
| 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: []
         |