documentation-zero 0.0.10 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{.documentation_api → .api}/README.md +7 -0
- data/{.documentation_api → .api}/sections/posts.md +2 -3
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/documentation_zero/version.rb +1 -1
- data/lib/generators/documentation/readme/readme_generator.rb +3 -1
- data/lib/generators/documentation/readme/templates/README.md.tt +7 -0
- data/lib/generators/documentation/scaffold/scaffold_generator.rb +2 -1
- data/lib/generators/documentation/scaffold/templates/resource.md.tt +2 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4746ff3f223a95242e7fd9c5822a30f4227d3e328b957e06e609ff9843a81e2
|
4
|
+
data.tar.gz: 4b4704d8cd4905d4c76daa28f7b1902feae78bb9d1df6a5a97f4898b5f06a814
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dfe383d00f94cfa094112fc505695fe79d969df90adbeabc0019446e6e55dd43d18b4f73d137de016a2a76f3893f5b7ccfae547928eb40480169835bf153bd0
|
7
|
+
data.tar.gz: 70d79a64c92186376aa494fa86232e1d59eb7b762cf2e1cac5ced854636774b166c831701ff6ce8e2e37100bd6adb1e5971243ad31032e2982834ed0da09c777
|
@@ -12,6 +12,10 @@ To make a request for all the resources on your account, append the `resources`
|
|
12
12
|
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'User-Agent: MyApp (yourname@example.com)' https://example.com/api/resources.json
|
13
13
|
```
|
14
14
|
|
15
|
+
## Authentication
|
16
|
+
|
17
|
+
Describe your authentication here.
|
18
|
+
|
15
19
|
## Identifying your application
|
16
20
|
|
17
21
|
You must include a `User-Agent` header with **both**:
|
@@ -64,6 +68,9 @@ If Rails tabler is having trouble, you will get a response with a 5xx status cod
|
|
64
68
|
|
65
69
|
API requests may 404 due to deleted content, an inactive account, missing user permissions, etc. Detect these conditions to give your users a clear explanation about why they can't connect to Rails tabler. Do not automatically retry these requests.
|
66
70
|
|
71
|
+
* Inactive account. 404 Not Found response with a `Reason: Account Inactive` header. Due to an expired trial or account suspension. All API requests to an inactive account will fail, so we recommend detecting and disabling the account in your integration as well.
|
72
|
+
* Inaccessible items. 404 Not Found response. Due to a deleted item or insufficient permissions.
|
73
|
+
|
67
74
|
## API endpoints
|
68
75
|
|
69
76
|
<!-- START API ENDPOINTS -->
|
@@ -67,14 +67,13 @@ This endpoint will return `200 OK` with the current JSON representation of the p
|
|
67
67
|
|
68
68
|
This endpoint will return `204 No Content` if successful. No parameters are required.
|
69
69
|
|
70
|
-
---
|
71
|
-
|
72
70
|
## Models
|
73
71
|
|
74
|
-
|
72
|
+
### Post model
|
75
73
|
|
76
74
|
```json
|
77
75
|
{
|
76
|
+
"id": "integer",
|
78
77
|
"title": "string",
|
79
78
|
"content": "string",
|
80
79
|
"published": "boolean",
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ The purpose of documentation zero is to generate a scaffold for rails api docume
|
|
4
4
|
|
5
5
|
## Example
|
6
6
|
|
7
|
-
You can see an example of the generated documentation [here](.
|
7
|
+
You can see an example of the generated documentation [here](.api/README.md).
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -3,8 +3,10 @@ module Documentation
|
|
3
3
|
class ReadmeGenerator < Rails::Generators::Base
|
4
4
|
source_root File.expand_path("templates", __dir__)
|
5
5
|
|
6
|
+
class_option :directory, type: :string, default: ".api"
|
7
|
+
|
6
8
|
def copy_files
|
7
|
-
template "README.md", ".
|
9
|
+
template "README.md", "#{options.directory}/README.md"
|
8
10
|
end
|
9
11
|
|
10
12
|
private
|
@@ -12,6 +12,10 @@ To make a request for all the resources on your account, append the `resources`
|
|
12
12
|
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'User-Agent: MyApp (yourname@example.com)' https://example.com/api/resources.json
|
13
13
|
```
|
14
14
|
|
15
|
+
## Authentication
|
16
|
+
|
17
|
+
Describe your authentication here.
|
18
|
+
|
15
19
|
## Identifying your application
|
16
20
|
|
17
21
|
You must include a `User-Agent` header with **both**:
|
@@ -64,6 +68,9 @@ If <%= application_name.humanize %> is having trouble, you will get a response w
|
|
64
68
|
|
65
69
|
API requests may 404 due to deleted content, an inactive account, missing user permissions, etc. Detect these conditions to give your users a clear explanation about why they can't connect to <%= application_name.humanize %>. Do not automatically retry these requests.
|
66
70
|
|
71
|
+
* Inactive account. 404 Not Found response with a `Reason: Account Inactive` header. Due to an expired trial or account suspension. All API requests to an inactive account will fail, so we recommend detecting and disabling the account in your integration as well.
|
72
|
+
* Inaccessible items. 404 Not Found response. Due to a deleted item or insufficient permissions.
|
73
|
+
|
67
74
|
## API endpoints
|
68
75
|
|
69
76
|
<!-- START API ENDPOINTS -->
|
@@ -3,12 +3,13 @@ module Documentation
|
|
3
3
|
class ScaffoldGenerator < Rails::Generators::NamedBase
|
4
4
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
5
5
|
|
6
|
+
class_option :directory, type: :string, default: ".api"
|
6
7
|
class_option :timestamps, type: :boolean, default: true
|
7
8
|
|
8
9
|
source_root File.expand_path("templates", __dir__)
|
9
10
|
|
10
11
|
def copy_files
|
11
|
-
template "resource.md", ".
|
12
|
+
template "resource.md", "#{options.directory}/sections/#{plural_file_name}.md"
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -65,14 +65,13 @@ This endpoint will return `200 OK` with the current JSON representation of the <
|
|
65
65
|
|
66
66
|
This endpoint will return `204 No Content` if successful. No parameters are required.
|
67
67
|
|
68
|
-
---
|
69
|
-
|
70
68
|
## Models
|
71
69
|
|
72
|
-
|
70
|
+
### <%= class_name %> model
|
73
71
|
|
74
72
|
```json
|
75
73
|
{
|
74
|
+
"id": "integer",
|
76
75
|
<% attributes.each do |attribute| -%>
|
77
76
|
<% if attribute.password_digest? -%>
|
78
77
|
"password_digest": "string",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: documentation-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -17,8 +17,8 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".
|
21
|
-
- ".
|
20
|
+
- ".api/README.md"
|
21
|
+
- ".api/sections/posts.md"
|
22
22
|
- CHANGELOG.md
|
23
23
|
- CODE_OF_CONDUCT.md
|
24
24
|
- Gemfile
|