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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff402148f82601329555c80c61abcf03b5aad5f8
4
- data.tar.gz: 3e813a085a3f97ac4a22c0bb4868d2794aa92d66
3
+ metadata.gz: 48952709ccb91672a6df0ec3677c3b162547d746
4
+ data.tar.gz: edbbd4991455d90c2794e334a31c32dbea4c7345
5
5
  SHA512:
6
- metadata.gz: 8ec2b8a330539a058e6c9a1b454635016ffcdc53374a661fb58eed1de6adb404ab0085f18d2e99f4ed7c99a091cb7ddf649bcc74fa5676dad4ed24f2a02e05ac
7
- data.tar.gz: cd298cfd7e25d2ad6abcc1cc78c1d63d406f2a41a7f12505b0f2261302a319df3229878c1db0af2cd389b0e1c72b57b02cb2a1c980defff283ab8d324e992277
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
@@ -2,7 +2,6 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'pry'
6
5
  gem 'rails', '~> 5.0'
7
6
  gem 'mime-types', '~> 2.99.3'
8
7
  gem 'rails-controller-testing'
@@ -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 = HashWithIndifferentAccess.new { |h, version| h[version] = {} }
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 = Hash.new { |h, controller| h[controller] = [] }
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 = 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
@@ -1,3 +1,3 @@
1
1
  module Apipie
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
@@ -7,6 +7,4 @@ class ExtendedController < ApplicationController
7
7
  end
8
8
  def create
9
9
  end
10
-
11
- include Concerns::ExtendingConcern
12
10
  end
@@ -41,5 +41,9 @@ module Dummy
41
41
 
42
42
  # Configure sensitive parameters which will be filtered from the log file.
43
43
  config.filter_parameters += [:password]
44
+
45
+ config.to_prepare do
46
+ ExtendedController.send(:include, Concerns::ExtendingConcern)
47
+ end
44
48
  end
45
49
  end
@@ -1,6 +1,8 @@
1
1
  Apipie.configure do |config|
2
2
  config.app_name = "Test app"
3
3
  config.copyright = "&copy; 2012 Pavel Pokorny"
4
+ config.languages = ['en']
5
+ config.default_locale = 'en'
4
6
 
5
7
  # set default API version
6
8
  # can be overriden in resource_description
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.2
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-08-21 00:00:00.000000000 Z
12
+ date: 2017-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails