apipie-rails 0.5.2 → 0.5.3
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.rails50 +0 -1
- data/lib/apipie/application.rb +8 -8
- data/lib/apipie/extractor/recorder.rb +5 -1
- data/lib/apipie/version.rb +1 -1
- data/spec/dummy/app/controllers/extended_controller.rb +0 -2
- data/spec/dummy/config/application.rb +4 -0
- data/spec/dummy/config/initializers/apipie.rb +2 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 48952709ccb91672a6df0ec3677c3b162547d746
         | 
| 4 | 
            +
              data.tar.gz: edbbd4991455d90c2794e334a31c32dbea4c7345
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4221d7618ae16227197545936ce325b837cba3538678640e3997f64efd38e1a0b478d66318b516e9ef266d7156795dc9e67e10a2b8153f0d94110d44b7d875dc
         | 
| 7 | 
            +
              data.tar.gz: ca71c77b37c840357d8dd64396d7a91b4ea80f2ed7ddcf4824011e431a846bbd0610aca424453192e56fce088c89702092ed8f78d0831cbc1b388cc89ccbb7b7
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,6 +1,12 @@ | |
| 1 1 | 
             
             Changelog
         | 
| 2 2 | 
             
            ===========
         | 
| 3 3 |  | 
| 4 | 
            +
            v0.5.3
         | 
| 5 | 
            +
            ------
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            - Fix reloading when extending the apidoc from concern [\#557](https://github.com/Apipie/apipie-rails/pull/557) ([iNecas](https://github.com/iNecas))
         | 
| 8 | 
            +
            - Fix example recording when using send\_file [\#504](https://github.com/Apipie/apipie-rails/pull/504) ([tdeo](https://github.com/tdeo))
         | 
| 9 | 
            +
             | 
| 4 10 | 
             
            v0.5.2
         | 
| 5 11 | 
             
            ------
         | 
| 6 12 |  | 
    
        data/Gemfile.rails50
    CHANGED
    
    
    
        data/lib/apipie/application.rb
    CHANGED
    
    | @@ -121,7 +121,7 @@ module Apipie | |
| 121 121 | 
             
                # resource_description? It's used to derivate the default value of
         | 
| 122 122 | 
             
                # versions for methods.
         | 
| 123 123 | 
             
                def controller_versions(controller)
         | 
| 124 | 
            -
                  ret = @controller_versions[controller]
         | 
| 124 | 
            +
                  ret = @controller_versions[controller.to_s]
         | 
| 125 125 | 
             
                  return ret unless ret.empty?
         | 
| 126 126 | 
             
                  if controller == ActionController::Base || controller.nil?
         | 
| 127 127 | 
             
                    return [Apipie.configuration.default_version]
         | 
| @@ -131,7 +131,7 @@ module Apipie | |
| 131 131 | 
             
                end
         | 
| 132 132 |  | 
| 133 133 | 
             
                def set_controller_versions(controller, versions)
         | 
| 134 | 
            -
                  @controller_versions[controller] = versions
         | 
| 134 | 
            +
                  @controller_versions[controller.to_s] = versions
         | 
| 135 135 | 
             
                end
         | 
| 136 136 |  | 
| 137 137 | 
             
                def add_param_group(controller, name, &block)
         | 
| @@ -205,7 +205,7 @@ module Apipie | |
| 205 205 | 
             
                      return nil
         | 
| 206 206 | 
             
                    end
         | 
| 207 207 | 
             
                    resource_description = get_resource_description(resource_name)
         | 
| 208 | 
            -
                    if resource_description && resource_description.controller == resource
         | 
| 208 | 
            +
                    if resource_description && resource_description.controller.to_s == resource.to_s
         | 
| 209 209 | 
             
                      return resource_description
         | 
| 210 210 | 
             
                    end
         | 
| 211 211 | 
             
                  end
         | 
| @@ -236,12 +236,12 @@ module Apipie | |
| 236 236 |  | 
| 237 237 | 
             
                # initialize variables for gathering dsl data
         | 
| 238 238 | 
             
                def init_env
         | 
| 239 | 
            -
                  @resource_descriptions  | 
| 240 | 
            -
                  @controller_to_resource_id  | 
| 241 | 
            -
                  @param_groups  | 
| 239 | 
            +
                  @resource_descriptions ||= HashWithIndifferentAccess.new { |h, version| h[version] = {} }
         | 
| 240 | 
            +
                  @controller_to_resource_id ||= {}
         | 
| 241 | 
            +
                  @param_groups ||= {}
         | 
| 242 242 |  | 
| 243 243 | 
             
                  # what versions does the controller belong in (specified by resource_description)?
         | 
| 244 | 
            -
                  @controller_versions  | 
| 244 | 
            +
                  @controller_versions ||= Hash.new { |h, controller| h[controller.to_s] = [] }
         | 
| 245 245 | 
             
                end
         | 
| 246 246 |  | 
| 247 247 | 
             
                def recorded_examples
         | 
| @@ -385,7 +385,7 @@ module Apipie | |
| 385 385 | 
             
                end
         | 
| 386 386 |  | 
| 387 387 | 
             
                def version_prefix(klass)
         | 
| 388 | 
            -
                  version = controller_versions(klass).first
         | 
| 388 | 
            +
                  version = controller_versions(klass.to_s).first
         | 
| 389 389 | 
             
                  base_url = get_base_url(version)
         | 
| 390 390 | 
             
                  return "/" if base_url.blank?
         | 
| 391 391 | 
             
                  base_url[1..-1] + "/"
         | 
| @@ -28,7 +28,11 @@ module Apipie | |
| 28 28 |  | 
| 29 29 | 
             
                  def analyse_response(response)
         | 
| 30 30 | 
             
                    if response.last.respond_to?(:body) && data = parse_data(response.last.body)
         | 
| 31 | 
            -
                      @response_data =  | 
| 31 | 
            +
                      @response_data = if response[1]['Content-Disposition'].to_s.start_with?('attachment')
         | 
| 32 | 
            +
                                         '<STREAMED ATTACHMENT FILE>'
         | 
| 33 | 
            +
                                       else
         | 
| 34 | 
            +
                                         data
         | 
| 35 | 
            +
                                       end
         | 
| 32 36 | 
             
                    end
         | 
| 33 37 | 
             
                    @code = response.first
         | 
| 34 38 | 
             
                  end
         | 
    
        data/lib/apipie/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: apipie-rails
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Pavel Pokorny
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2017- | 
| 12 | 
            +
            date: 2017-09-07 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rails
         |