apidoco 1.1.0 → 1.2.0

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: 836fbe0bd6933ee652a96869dd52b15c44d238c7
4
- data.tar.gz: 77dba2b50bf1326d645c93bfe08191561d946814
3
+ metadata.gz: 39f1a2c7a190223f718f59d453ae376c894565a4
4
+ data.tar.gz: 3410841490a9e021dcc754dea4a2de9848318fb8
5
5
  SHA512:
6
- metadata.gz: 756d476634f4637e2e7a983462741b0328189c1f156eed3dd8bba3331fda106d7e670d3620c8a9304fdf3719a7d032b26e095ee85940bc5138660cbfe9f113f8
7
- data.tar.gz: fcd352ab9d66bc382b73ee396f4fa80c89e143400b648b89ae919a78db201b6a91179593fbb25a08214a29e2d3fb5b7a04bd8447622baa9b6f611b60adf57aaa
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
- children.map { |c| JSON.parse(File.read(c)) }
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
@@ -1,3 +1,3 @@
1
1
  module Apidoco
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -14,7 +14,7 @@ module Apidoco
14
14
  def as_json
15
15
  {
16
16
  name: name,
17
- base_url: "",
17
+ base_url: '',
18
18
  apis: resource_documentations.flat_map(&:as_json)
19
19
  }
20
20
  end
@@ -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]}",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidoco
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Al Ameen