documentation-zero 0.0.9 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25b3388ee2af025b7d1144d1f359c18ce4d75daf4d2d6e69845b4c642174cc43
4
- data.tar.gz: 50e5e4c9b83f9a1315861cef29a97f1415394357adb82b97f69504a095ca7205
3
+ metadata.gz: b62c9f05259ec220fa355a9ae8e9f3a389866cdcdc503a4c2010d917cbbdf0ee
4
+ data.tar.gz: 1c461ff6f9cb65d5a2a05e5247ef44e214db96055ddf4ca607629c7c60de7a7d
5
5
  SHA512:
6
- metadata.gz: 6f093fa94fd57cc9159a0130635164c468e2541744ecee8d7b9693569a9c04542179a65d37dcd07083ad4006c9e71b8a5b4d8e52dd035dde4f71a09e338f17cf
7
- data.tar.gz: 0ae4198e2eca599ae54a4594692e712e31e42a33f62fb8a7cf497a40a7abb97bf75b64555f1606b57f3816a274bdfeceb9245809fc9aa97075316993d63dffaf
6
+ metadata.gz: 0d6df1ef4f4ab2f39edb8f649ac9cd3058a961369ae8184e437348bbe026ce49dd1e1889daf7c38618a5262d8d6c1b4057a87c53b1616d38126888590dc9f59d
7
+ data.tar.gz: cd0436401778e7407177d623016e5c6a536a78898f10a060fbb970c47b3dc0db43f5018518e8c54ce4afe2166e01f76e891212688c7881f35074a62e520d8a27
@@ -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 -->
File without changes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- documentation-zero (0.0.9)
4
+ documentation-zero (0.0.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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](.documentation_api/README.md).
7
+ You can see an example of the generated documentation [here](.api/README.md).
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,3 +1,3 @@
1
1
  module DocumentationZero
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -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", ".documentation_api/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 -->
@@ -2,10 +2,14 @@ module Documentation
2
2
  module Generators
3
3
  class ScaffoldGenerator < Rails::Generators::NamedBase
4
4
  argument :attributes, type: :array, default: [], banner: "field:type field:type"
5
+
6
+ class_option :directory, type: :string, default: ".api"
7
+ class_option :timestamps, type: :boolean, default: true
8
+
5
9
  source_root File.expand_path("templates", __dir__)
6
10
 
7
11
  def copy_files
8
- template "resource.md", ".documentation_api/sections/#{plural_file_name}.md"
12
+ template "resource.md", "#{options.directory}/sections/#{plural_file_name}.md"
9
13
  end
10
14
  end
11
15
  end
@@ -65,11 +65,9 @@ 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
- ###### <%= class_name %> model
70
+ ### <%= class_name %> model
73
71
 
74
72
  ```json
75
73
  {
@@ -84,7 +82,9 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
84
82
  "<%= attribute.column_name %>": "<%= attribute.type %>",
85
83
  <% end -%>
86
84
  <% end -%>
85
+ <% if options.timestamps? -%>
87
86
  "created_at": "datetime",
88
87
  "updated_at": "datetime"
88
+ <% end -%>
89
89
  }
90
90
  ```
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.9
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-19 00:00:00.000000000 Z
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
- - ".documentation_api/README.md"
21
- - ".documentation_api/sections/posts.md"
20
+ - ".api/README.md"
21
+ - ".api/sections/posts.md"
22
22
  - CHANGELOG.md
23
23
  - CODE_OF_CONDUCT.md
24
24
  - Gemfile