rspec_api_documentation 4.5.0 → 4.6.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d028dba15444ec4ec3da4d6be2f55832bfe1348f
|
4
|
+
data.tar.gz: 299d1b2d9bd7d9600975fbfd5982999405cab9cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a74792e3e273c9522f4047e8edac0819abffb4bdb1a82d8984ad6ca3077a06869361b28d95207ae2efd3696ffb2cb611d1fe19c7bc9fdd6d034c73bbe1cd967d
|
7
|
+
data.tar.gz: 397c2218f5cfaf98654ea1ba251b4156388d4ec3341f07ebd9b741af19fe2551860a7ab6e3b3746db067a28f8572a8a91164d85498d8e92022700b21030a15b0
|
@@ -39,14 +39,11 @@ module RspecApiDocumentation::DSL
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def parameter(name, *args)
|
42
|
-
|
43
|
-
description = args.pop || "#{Array(options[:scope]).join(" ")} #{name}".humanize
|
44
|
-
|
45
|
-
parameters.push(options.merge(:name => name.to_s, :description => description))
|
42
|
+
parameters.push(field_specification(name, *args))
|
46
43
|
end
|
47
44
|
|
48
|
-
def response_field(name,
|
49
|
-
response_fields.push(
|
45
|
+
def response_field(name, *args)
|
46
|
+
response_fields.push(field_specification(name, *args))
|
50
47
|
end
|
51
48
|
|
52
49
|
def header(name, value)
|
@@ -55,6 +52,13 @@ module RspecApiDocumentation::DSL
|
|
55
52
|
|
56
53
|
private
|
57
54
|
|
55
|
+
def field_specification(name, *args)
|
56
|
+
options = args.extract_options!
|
57
|
+
description = args.pop || "#{Array(options[:scope]).join(" ")} #{name}".humanize
|
58
|
+
|
59
|
+
options.merge(:name => name.to_s, :description => description)
|
60
|
+
end
|
61
|
+
|
58
62
|
def safe_metadata(field, default)
|
59
63
|
metadata[field] ||= default
|
60
64
|
if superclass_metadata && metadata[field].equal?(superclass_metadata[field])
|
@@ -7,8 +7,7 @@ module RspecApiDocumentation
|
|
7
7
|
env.each do |key, value|
|
8
8
|
# HTTP_ACCEPT_CHARSET => Accept-Charset
|
9
9
|
if key =~ /^(HTTP_|CONTENT_TYPE)/
|
10
|
-
header = key.gsub(/^HTTP_/, '').titleize.
|
11
|
-
header.concat('-Id') if key.scan(/_ID\Z/).any?
|
10
|
+
header = key.gsub(/^HTTP_/, '').split('_').map{|s| s.titleize}.join("-")
|
12
11
|
headers[header] = value
|
13
12
|
end
|
14
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_api_documentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Cahoon
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
323
|
version: 1.3.6
|
324
324
|
requirements: []
|
325
325
|
rubyforge_project:
|
326
|
-
rubygems_version: 2.
|
326
|
+
rubygems_version: 2.2.2
|
327
327
|
signing_key:
|
328
328
|
specification_version: 4
|
329
329
|
summary: A double black belt for your docs
|