apidoco 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/apidoco/resource_documentation.rb +10 -1
- data/lib/apidoco/version.rb +1 -1
- data/lib/apidoco/version_documentation.rb +1 -1
- data/lib/generators/apidoco_generator.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39f1a2c7a190223f718f59d453ae376c894565a4
|
4
|
+
data.tar.gz: 3410841490a9e021dcc754dea4a2de9848318fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bcb6f7c99a5b1132d495efcfac384249f0392d864727bfbb8765eee63e47a5a6d1c066536cb8e7de6ff05407dfe672f20fbabff15514fcb3a5b3d5778111148
|
7
|
+
data.tar.gz: 1ee1e1f63e806bcc2720e10fe0a8e236d97f8a6afc7459a43fdfa9b303ce3b16c2638cbda728c1cd88862f1aca74913e2c226908a34b38923c229e1f4916a9c7
|
data/README.md
CHANGED
@@ -62,6 +62,8 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
62
62
|
```
|
63
63
|
// docs/api/v1/posts/create.json
|
64
64
|
{
|
65
|
+
"published": true,
|
66
|
+
"sort_order": 1,
|
65
67
|
"name": "Create Post",
|
66
68
|
"end_point": "/posts",
|
67
69
|
"http_method": "POST",
|
@@ -98,6 +100,8 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
98
100
|
|
99
101
|
// docs/api/v1/posts/edit.json
|
100
102
|
{
|
103
|
+
"published": true,
|
104
|
+
"sort_order": 2,
|
101
105
|
"name": "Edit Post",
|
102
106
|
"end_point": "/posts",
|
103
107
|
"http_method": "POST",
|
@@ -129,6 +133,8 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
129
133
|
|
130
134
|
//docs/api/v1/posts/delete.json
|
131
135
|
{
|
136
|
+
"published": true,
|
137
|
+
"sort_order": 3,
|
132
138
|
"name": "Delete Post",
|
133
139
|
"end_point": "/posts",
|
134
140
|
"http_method": "POST",
|
@@ -7,7 +7,16 @@ module Apidoco
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def as_json
|
10
|
-
|
10
|
+
sort_json
|
11
|
+
end
|
12
|
+
|
13
|
+
def children_json
|
14
|
+
doco_apis = children.map { |c| JSON.parse(File.read(c)) }
|
15
|
+
doco_apis.delete_if { |h| h['published'] == false }
|
16
|
+
end
|
17
|
+
|
18
|
+
def sort_json
|
19
|
+
children_json.sort_by { |k| k['sort_order'] }
|
11
20
|
end
|
12
21
|
|
13
22
|
def children
|
data/lib/apidoco/version.rb
CHANGED
@@ -68,6 +68,8 @@ class ApidocoGenerator < Rails::Generators::Base
|
|
68
68
|
name = api_name(resource_name(resource), action)
|
69
69
|
<<-FILE
|
70
70
|
{
|
71
|
+
"published": true,
|
72
|
+
"sort_order": 100,
|
71
73
|
"name": "#{name}",
|
72
74
|
"end_point": "#{resource}#{endpoint_with_method[:endpoint]}",
|
73
75
|
"http_method": "#{endpoint_with_method[:method]}",
|