rspec-api-docs 0.7.0 → 0.8.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_docs/formatter.rb +2 -2
- data/lib/rspec_api_docs/formatter/resource.rb +14 -5
- data/lib/rspec_api_docs/version.rb +1 -1
- 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: 366d34d11131e28d3d3c88024ae9ffce5d2d2f27
|
4
|
+
data.tar.gz: 6a143737560c1d8ac8630a35761da4ac45e1efab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c144b0cb4b2e0684c141fa92fe5edba7492e2dcd8e28adfd7f02ce530326848efb0cb3179753d8e36e529b03af53742ebf2fec77cf36345d00ba3bb328ff8f82
|
7
|
+
data.tar.gz: 7eb7c7a1b0283bfacecde7db7069c116809e0adf6a1a48969549281716e370d4fd24bcff1898717124fdf03d319ce0b904c6fa7a0aecf24ab99a887fa500d109
|
@@ -33,14 +33,14 @@ module RspecApiDocs
|
|
33
33
|
return unless rspec_example.metadata[METADATA_NAMESPACE]
|
34
34
|
resource = Resource.new(rspec_example)
|
35
35
|
resources[resource.name] ||= resource
|
36
|
-
resources[resource.name].
|
36
|
+
resources[resource.name].add_example Resource::Example.new(rspec_example)
|
37
37
|
end
|
38
38
|
|
39
39
|
# Calls the configured renderer with the stored {Resource}s.
|
40
40
|
#
|
41
41
|
# @return [void]
|
42
42
|
def close(null_notification)
|
43
|
-
renderer.new(resources.values).render
|
43
|
+
renderer.new(resources.values.sort_by(&:name)).render
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
@@ -6,11 +6,6 @@ module RspecApiDocs
|
|
6
6
|
class Resource
|
7
7
|
attr_reader :rspec_example
|
8
8
|
|
9
|
-
# Returns an array of {Example}s
|
10
|
-
#
|
11
|
-
# @return [Array<Example>]
|
12
|
-
attr_accessor :examples
|
13
|
-
|
14
9
|
def initialize(rspec_example)
|
15
10
|
@rspec_example = rspec_example
|
16
11
|
@examples = []
|
@@ -34,6 +29,20 @@ module RspecApiDocs
|
|
34
29
|
metadata[:resource_description]
|
35
30
|
end
|
36
31
|
|
32
|
+
# Returns an array of {Example}s
|
33
|
+
#
|
34
|
+
# @return [Array<Example>]
|
35
|
+
def examples
|
36
|
+
@examples.sort_by(&:name)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Add an example
|
40
|
+
#
|
41
|
+
# @return [void]
|
42
|
+
def add_example(example)
|
43
|
+
@examples << example
|
44
|
+
end
|
45
|
+
|
37
46
|
private
|
38
47
|
|
39
48
|
def metadata
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-api-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Odin Dutton
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.5.
|
178
|
+
rubygems_version: 2.5.2
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Generate API documentation using RSpec
|