rspec_api_documentation 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec_api_documentation/configuration.rb +1 -0
- data/lib/rspec_api_documentation/curl.rb +6 -1
- data/lib/rspec_api_documentation/dsl.rb +1 -1
- data/lib/rspec_api_documentation/dsl/endpoint/set_param.rb +6 -4
- data/lib/rspec_api_documentation/views/markup_index.rb +2 -4
- data/lib/rspec_api_documentation/writers/json_iodocs_writer.rb +1 -0
- data/templates/rspec_api_documentation/html_index.mustache +1 -1
- data/templates/rspec_api_documentation/markdown_index.mustache +1 -0
- data/templates/rspec_api_documentation/textile_index.mustache +1 -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: 5b64de927068173bdb8b5090658a90cfdfdebd87
|
4
|
+
data.tar.gz: 7d671588a963248bb37ca1b86d2ccb6139c5e4d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45149d40631eb2c476fa099fb728da825ef831adbbe2032ae2ca07aa4b659e0950b6ac83c59568f83845c6328266a4a697ac8165308a385b2955c3a655143889
|
7
|
+
data.tar.gz: 06d59a0dd3153544799cdaa3803894f2e0210d97ff72e17812194a0b565ee5bc1b369e23ae6a66f93a8b03f54d0224024aa2adfa72d3ff774a084f5589ce795b
|
@@ -75,6 +75,7 @@ module RspecApiDocumentation
|
|
75
75
|
add_setting :curl_host, :default => nil
|
76
76
|
add_setting :keep_source_order, :default => false
|
77
77
|
add_setting :api_name, :default => "API Documentation"
|
78
|
+
add_setting :api_explanation, :default => nil
|
78
79
|
add_setting :io_docs_protocol, :default => "http"
|
79
80
|
add_setting :request_headers_to_include, :default => nil
|
80
81
|
add_setting :response_headers_to_include, :default => nil
|
@@ -69,7 +69,12 @@ module RspecApiDocumentation
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def format_full_header(header, value)
|
72
|
-
formatted_value =
|
72
|
+
formatted_value = if value.is_a?(Numeric)
|
73
|
+
value
|
74
|
+
else
|
75
|
+
value ? value.gsub(/"/, "\\\"") : ''
|
76
|
+
end
|
77
|
+
|
73
78
|
"#{format_header(header)}: #{formatted_value}"
|
74
79
|
end
|
75
80
|
|
@@ -21,7 +21,7 @@ module RspecApiDocumentation
|
|
21
21
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
22
22
|
options[:api_doc_dsl] = :resource
|
23
23
|
options[:resource_name] = args.first.to_s
|
24
|
-
options[:document]
|
24
|
+
options[:document] = :all unless options.key?(:document)
|
25
25
|
args.push(options)
|
26
26
|
describe(*args, &block)
|
27
27
|
end
|
@@ -45,10 +45,12 @@ module RspecApiDocumentation
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def method_name
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
if custom_method_name
|
49
|
+
custom_method_name if example_group.respond_to?(custom_method_name)
|
50
|
+
elsif scoped_key && example_group.respond_to?(scoped_key)
|
51
|
+
scoped_key
|
52
|
+
elsif key && example_group.respond_to?(key)
|
53
|
+
key
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
@@ -3,16 +3,14 @@ require 'mustache'
|
|
3
3
|
module RspecApiDocumentation
|
4
4
|
module Views
|
5
5
|
class MarkupIndex < Mustache
|
6
|
+
delegate :api_name, :api_explanation, to: :@configuration, prefix: false
|
7
|
+
|
6
8
|
def initialize(index, configuration)
|
7
9
|
@index = index
|
8
10
|
@configuration = configuration
|
9
11
|
self.template_path = configuration.template_path
|
10
12
|
end
|
11
13
|
|
12
|
-
def api_name
|
13
|
-
@configuration.api_name
|
14
|
-
end
|
15
|
-
|
16
14
|
def sections
|
17
15
|
RspecApiDocumentation::Writers::IndexHelper.sections(examples, @configuration)
|
18
16
|
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: 5.
|
4
|
+
version: 5.1.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: 2017-
|
13
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|