autodoc 0.7.1 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +29 -0
- data/.gitignore +0 -1
- data/CHANGELOG.md +27 -1
- data/Gemfile +0 -1
- data/Gemfile.lock +176 -0
- data/README.md +4 -0
- data/autodoc.gemspec +1 -1
- data/lib/autodoc/document.rb +4 -4
- data/lib/autodoc/templates/toc.md.erb +1 -1
- data/lib/autodoc/version.rb +1 -1
- data/spec/autodoc/documents_spec.rb +1 -1
- data/spec/dummy/app/controllers/recipes_controller.rb +1 -1
- data/spec/dummy/app/models/recipe.rb +0 -1
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/requests/recipes_spec.rb +7 -7
- metadata +7 -8
- data/spec/dummy/spec +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 47721414a1cf3631034dbe786a133d21922de3a4ca0689dd5d37112c9267d638
|
4
|
+
data.tar.gz: 6b398807f034927b9c8ec8749f028c0da00a254afb6a91e09fdd03f9a188602d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9602be06ef5819e7edc380dd0ae990ec844cc0e38e4244144ca336de0522f213acffce64cf3df75eab269cce3a4a03bd276352fbfe518e2e9257194fa1ec6074
|
7
|
+
data.tar.gz: 45030c275296700cd24e69ac95c0ade9f7bbb6e37a4cb23f9056d9037eb97e87f38a302f29164317381bf2da383f968246198890de8a50547fcfa4a158d76cf9
|
@@ -0,0 +1,29 @@
|
|
1
|
+
jobs:
|
2
|
+
rspec:
|
3
|
+
docker:
|
4
|
+
- image: ruby:2.5.3
|
5
|
+
steps:
|
6
|
+
- checkout
|
7
|
+
- restore_cache:
|
8
|
+
keys:
|
9
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
10
|
+
- v1-dependencies-
|
11
|
+
- run:
|
12
|
+
command: bundle install --jobs=4 --retry=3 --path vendor/bundle
|
13
|
+
name: bundle install
|
14
|
+
- save_cache:
|
15
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
16
|
+
paths:
|
17
|
+
- ./vendor/bundle
|
18
|
+
- run:
|
19
|
+
command: cd spec/dummy && RAILS_ENV=test bundle exec rails db:setup
|
20
|
+
name: rails db:setup
|
21
|
+
- run:
|
22
|
+
command: bundle exec rspec
|
23
|
+
name: rspec
|
24
|
+
version: 2
|
25
|
+
workflows:
|
26
|
+
version: 2
|
27
|
+
test:
|
28
|
+
jobs:
|
29
|
+
- rspec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -7,12 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
-
## 0.7.
|
10
|
+
## 0.7.6
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Replace `URI.unescape` with `URI.decode_www_form_component` for Ruby 3 support.
|
15
|
+
|
16
|
+
## 0.7.5
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Convert header key to string.
|
21
|
+
|
22
|
+
## 0.7.4 - 2020-04-14
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
|
26
|
+
- Improve error message on no request case.
|
27
|
+
|
28
|
+
## 0.7.3 - 2019-06-18
|
29
|
+
|
30
|
+
### Fixed
|
31
|
+
|
32
|
+
- Fix indent in toc template.
|
33
|
+
|
34
|
+
## 0.7.2 - 2019-01-09
|
11
35
|
|
12
36
|
### Fixed
|
13
37
|
|
14
38
|
- Fixed broken symlink on spec/dummy/spec.
|
15
39
|
|
40
|
+
## 0.7.1 - 2018-12-18
|
41
|
+
|
16
42
|
## 0.7.0 - 2018-08-30
|
17
43
|
|
18
44
|
### Changed
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
autodoc (0.7.5)
|
5
|
+
actionpack
|
6
|
+
activesupport (>= 3.0.0)
|
7
|
+
rspec
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actioncable (5.2.2)
|
13
|
+
actionpack (= 5.2.2)
|
14
|
+
nio4r (~> 2.0)
|
15
|
+
websocket-driver (>= 0.6.1)
|
16
|
+
actionmailer (5.2.2)
|
17
|
+
actionpack (= 5.2.2)
|
18
|
+
actionview (= 5.2.2)
|
19
|
+
activejob (= 5.2.2)
|
20
|
+
mail (~> 2.5, >= 2.5.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
actionpack (5.2.2)
|
23
|
+
actionview (= 5.2.2)
|
24
|
+
activesupport (= 5.2.2)
|
25
|
+
rack (~> 2.0)
|
26
|
+
rack-test (>= 0.6.3)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
+
actionview (5.2.2)
|
30
|
+
activesupport (= 5.2.2)
|
31
|
+
builder (~> 3.1)
|
32
|
+
erubi (~> 1.4)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
+
activejob (5.2.2)
|
36
|
+
activesupport (= 5.2.2)
|
37
|
+
globalid (>= 0.3.6)
|
38
|
+
activemodel (5.2.2)
|
39
|
+
activesupport (= 5.2.2)
|
40
|
+
activerecord (5.2.2)
|
41
|
+
activemodel (= 5.2.2)
|
42
|
+
activesupport (= 5.2.2)
|
43
|
+
arel (>= 9.0)
|
44
|
+
activestorage (5.2.2)
|
45
|
+
actionpack (= 5.2.2)
|
46
|
+
activerecord (= 5.2.2)
|
47
|
+
marcel (~> 0.3.1)
|
48
|
+
activesupport (5.2.2)
|
49
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
|
+
i18n (>= 0.7, < 2)
|
51
|
+
minitest (~> 5.1)
|
52
|
+
tzinfo (~> 1.1)
|
53
|
+
arel (9.0.0)
|
54
|
+
builder (3.2.3)
|
55
|
+
coderay (1.1.1)
|
56
|
+
concurrent-ruby (1.1.4)
|
57
|
+
crass (1.0.5)
|
58
|
+
diff-lcs (1.3)
|
59
|
+
erubi (1.8.0)
|
60
|
+
globalid (0.4.1)
|
61
|
+
activesupport (>= 4.2.0)
|
62
|
+
i18n (1.3.0)
|
63
|
+
concurrent-ruby (~> 1.0)
|
64
|
+
loofah (2.3.1)
|
65
|
+
crass (~> 1.0.2)
|
66
|
+
nokogiri (>= 1.5.9)
|
67
|
+
mail (2.7.1)
|
68
|
+
mini_mime (>= 0.1.1)
|
69
|
+
marcel (0.3.3)
|
70
|
+
mimemagic (~> 0.3.2)
|
71
|
+
method_source (0.8.2)
|
72
|
+
mimemagic (0.3.3)
|
73
|
+
mini_mime (1.0.1)
|
74
|
+
mini_portile2 (2.5.0)
|
75
|
+
minitest (5.11.3)
|
76
|
+
nio4r (2.3.1)
|
77
|
+
nokogiri (1.11.1)
|
78
|
+
mini_portile2 (~> 2.5.0)
|
79
|
+
racc (~> 1.4)
|
80
|
+
pry (0.10.4)
|
81
|
+
coderay (~> 1.1.0)
|
82
|
+
method_source (~> 0.8.1)
|
83
|
+
slop (~> 3.4)
|
84
|
+
pry-rails (0.3.6)
|
85
|
+
pry (>= 0.10.4)
|
86
|
+
racc (1.5.2)
|
87
|
+
rack (2.2.3)
|
88
|
+
rack-test (1.1.0)
|
89
|
+
rack (>= 1.0, < 3)
|
90
|
+
rails (5.2.2)
|
91
|
+
actioncable (= 5.2.2)
|
92
|
+
actionmailer (= 5.2.2)
|
93
|
+
actionpack (= 5.2.2)
|
94
|
+
actionview (= 5.2.2)
|
95
|
+
activejob (= 5.2.2)
|
96
|
+
activemodel (= 5.2.2)
|
97
|
+
activerecord (= 5.2.2)
|
98
|
+
activestorage (= 5.2.2)
|
99
|
+
activesupport (= 5.2.2)
|
100
|
+
bundler (>= 1.3.0)
|
101
|
+
railties (= 5.2.2)
|
102
|
+
sprockets-rails (>= 2.0.0)
|
103
|
+
rails-dom-testing (2.0.3)
|
104
|
+
activesupport (>= 4.2.0)
|
105
|
+
nokogiri (>= 1.6)
|
106
|
+
rails-html-sanitizer (1.0.4)
|
107
|
+
loofah (~> 2.2, >= 2.2.2)
|
108
|
+
railties (5.2.2)
|
109
|
+
actionpack (= 5.2.2)
|
110
|
+
activesupport (= 5.2.2)
|
111
|
+
method_source
|
112
|
+
rake (>= 0.8.7)
|
113
|
+
thor (>= 0.19.0, < 2.0)
|
114
|
+
rake (13.0.1)
|
115
|
+
redcarpet (3.5.1)
|
116
|
+
responders (2.4.0)
|
117
|
+
actionpack (>= 4.2.0, < 5.3)
|
118
|
+
railties (>= 4.2.0, < 5.3)
|
119
|
+
rspec (3.6.0)
|
120
|
+
rspec-core (~> 3.6.0)
|
121
|
+
rspec-expectations (~> 3.6.0)
|
122
|
+
rspec-mocks (~> 3.6.0)
|
123
|
+
rspec-core (3.6.0)
|
124
|
+
rspec-support (~> 3.6.0)
|
125
|
+
rspec-expectations (3.6.0)
|
126
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
+
rspec-support (~> 3.6.0)
|
128
|
+
rspec-mocks (3.6.0)
|
129
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
130
|
+
rspec-support (~> 3.6.0)
|
131
|
+
rspec-rails (3.6.1)
|
132
|
+
actionpack (>= 3.0)
|
133
|
+
activesupport (>= 3.0)
|
134
|
+
railties (>= 3.0)
|
135
|
+
rspec-core (~> 3.6.0)
|
136
|
+
rspec-expectations (~> 3.6.0)
|
137
|
+
rspec-mocks (~> 3.6.0)
|
138
|
+
rspec-support (~> 3.6.0)
|
139
|
+
rspec-support (3.6.0)
|
140
|
+
slop (3.6.0)
|
141
|
+
sprockets (3.7.2)
|
142
|
+
concurrent-ruby (~> 1.0)
|
143
|
+
rack (> 1, < 3)
|
144
|
+
sprockets-rails (3.2.1)
|
145
|
+
actionpack (>= 4.0)
|
146
|
+
activesupport (>= 4.0)
|
147
|
+
sprockets (>= 3.0.0)
|
148
|
+
sqlite3 (1.3.13)
|
149
|
+
thor (0.20.3)
|
150
|
+
thread_safe (0.3.6)
|
151
|
+
tzinfo (1.2.5)
|
152
|
+
thread_safe (~> 0.1)
|
153
|
+
weak_parameters (0.4.2)
|
154
|
+
rails (>= 4.0.0)
|
155
|
+
websocket-driver (0.7.0)
|
156
|
+
websocket-extensions (>= 0.1.0)
|
157
|
+
websocket-extensions (0.1.5)
|
158
|
+
|
159
|
+
PLATFORMS
|
160
|
+
ruby
|
161
|
+
|
162
|
+
DEPENDENCIES
|
163
|
+
autodoc!
|
164
|
+
bundler (~> 1.3)
|
165
|
+
pry-rails
|
166
|
+
rack-test
|
167
|
+
rails (= 5.2.2)
|
168
|
+
rake
|
169
|
+
redcarpet
|
170
|
+
responders
|
171
|
+
rspec-rails
|
172
|
+
sqlite3
|
173
|
+
weak_parameters
|
174
|
+
|
175
|
+
BUNDLED WITH
|
176
|
+
1.17.3
|
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
# Autodoc
|
2
|
+
|
3
|
+
[![CircleCI](https://circleci.com/gh/r7kamura/autodoc.svg?style=svg)](https://circleci.com/gh/r7kamura/autodoc)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/autodoc.svg)](https://rubygems.org/gems/autodoc)
|
5
|
+
|
2
6
|
Generate documentation from your rack application & request-spec.
|
3
7
|
|
4
8
|
## Installation
|
data/autodoc.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "actionpack"
|
22
22
|
spec.add_dependency "rspec"
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
-
spec.add_development_dependency "rails", "
|
24
|
+
spec.add_development_dependency "rails", "5.2.2"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "sqlite3"
|
27
27
|
end
|
data/lib/autodoc/document.rb
CHANGED
@@ -73,7 +73,7 @@ module Autodoc
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def method
|
76
|
-
request.
|
76
|
+
request.request_method
|
77
77
|
end
|
78
78
|
|
79
79
|
def request_header
|
@@ -87,8 +87,8 @@ module Autodoc
|
|
87
87
|
|
88
88
|
def request_header_from_http_prefix
|
89
89
|
request.headers.inject({}) do |table, (key, value)|
|
90
|
-
if key.start_with?("HTTP_")
|
91
|
-
table.merge(key.gsub(/^HTTP_/, "") => value)
|
90
|
+
if key.to_s.start_with?("HTTP_")
|
91
|
+
table.merge(key.to_s.gsub(/^HTTP_/, "") => value)
|
92
92
|
else
|
93
93
|
table
|
94
94
|
end
|
@@ -106,7 +106,7 @@ module Autodoc
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def request_query
|
109
|
-
"?#{URI.
|
109
|
+
"?#{URI.decode_www_form_component(request.query_string.force_encoding(Encoding::UTF_8))}" unless request.query_string.empty?
|
110
110
|
end
|
111
111
|
|
112
112
|
def request_body_section
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% documents.group_by(&:title).each do |title, docs| -%>
|
7
7
|
<% docs.each_with_index do |document, index| -%>
|
8
8
|
<% suffix = index == 0 ? "" : "-#{index}" -%>
|
9
|
-
|
9
|
+
* [<%= title %>](<%= "#{relative_path}##{document.identifier}#{suffix}" %>)
|
10
10
|
<% end -%>
|
11
11
|
<% end -%>
|
12
12
|
<% end -%>
|
data/lib/autodoc/version.rb
CHANGED
@@ -44,7 +44,6 @@ module Dummy
|
|
44
44
|
# like if you have constraints or database-specific column types
|
45
45
|
# config.active_record.schema_format = :sql
|
46
46
|
|
47
|
-
|
48
|
-
config.assets.version = '1.0'
|
47
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true
|
49
48
|
end
|
50
49
|
end
|
@@ -4,5 +4,5 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.
|
7
|
+
Dummy::Application.config.secret_key_base = '2da8e59639e7c92b0da46798ed97a45be5834c72cdd9a4ad141dadc5b1175f991b05ef02dde00f9c27cadb3790311e642010b89ed1dad598539980a1ae88be61'
|
8
8
|
Dummy::Application.config.secret_key_base = '7bea42a7812ad8da2fa753be701ed39a8b35f014c0cfcc876ad08180f2b25504e67ed24fc4470c51b229bbbc4731454c912e4609902e1c0bba65fb86037f7f1a'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe "Recipes", type: :request do
|
4
|
-
let(:
|
4
|
+
let(:headers) do
|
5
5
|
{ "ACCEPT" => "application/json", "CONTENT_TYPE" => "application/json" }
|
6
6
|
end
|
7
7
|
|
@@ -16,13 +16,13 @@ describe "Recipes", type: :request do
|
|
16
16
|
|
17
17
|
context "with valid condition (using Rack::Test)", autodoc: true do
|
18
18
|
before do
|
19
|
-
|
19
|
+
headers["Content-Type"] = "application/json"
|
20
20
|
end
|
21
21
|
|
22
22
|
include Rack::Test::Methods
|
23
23
|
|
24
24
|
it "returns the recipe" do
|
25
|
-
get "/recipes/#{recipe.id}",
|
25
|
+
get "/recipes/#{recipe.id}", headers: headers, params: params.to_json
|
26
26
|
expect(last_response.status).to eq(200)
|
27
27
|
end
|
28
28
|
end
|
@@ -40,7 +40,7 @@ describe "Recipes", type: :request do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "returns 400" do
|
43
|
-
post "/recipes", params.to_json
|
43
|
+
post "/recipes", headers: headers, params: params.to_json
|
44
44
|
expect(response.status).to eq(400)
|
45
45
|
end
|
46
46
|
end
|
@@ -51,7 +51,7 @@ describe "Recipes", type: :request do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "returns 400" do
|
54
|
-
post "/recipes", params.to_json
|
54
|
+
post "/recipes", headers: headers, params: params.to_json
|
55
55
|
expect(response.status).to eq(400)
|
56
56
|
end
|
57
57
|
end
|
@@ -62,7 +62,7 @@ describe "Recipes", type: :request do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "creates a new recipe" do
|
65
|
-
post "/recipes", params.to_json
|
65
|
+
post "/recipes", headers: headers, params: params.to_json
|
66
66
|
expect(response.status).to eq(201)
|
67
67
|
end
|
68
68
|
end
|
@@ -78,7 +78,7 @@ describe "Recipes", type: :request do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it "creates a new recipe" do
|
81
|
-
post "/recipes", params.to_json
|
81
|
+
post "/recipes", headers: headers, params: params.to_json
|
82
82
|
expect(response.status).to eq(201)
|
83
83
|
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 5.2.2
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 5.2.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,9 +115,11 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- ".circleci/config.yml"
|
118
119
|
- ".gitignore"
|
119
120
|
- CHANGELOG.md
|
120
121
|
- Gemfile
|
122
|
+
- Gemfile.lock
|
121
123
|
- LICENSE.txt
|
122
124
|
- README.md
|
123
125
|
- Rakefile
|
@@ -175,7 +177,6 @@ files:
|
|
175
177
|
- spec/dummy/public/500.html
|
176
178
|
- spec/dummy/public/favicon.ico
|
177
179
|
- spec/dummy/script/rails
|
178
|
-
- spec/dummy/spec
|
179
180
|
- spec/requests/admin/entries_spec.rb
|
180
181
|
- spec/requests/entries_spec.rb
|
181
182
|
- spec/requests/pending_spec.rb
|
@@ -200,8 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
201
|
- !ruby/object:Gem::Version
|
201
202
|
version: '0'
|
202
203
|
requirements: []
|
203
|
-
|
204
|
-
rubygems_version: 2.6.11
|
204
|
+
rubygems_version: 3.1.4
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Auto-generate JSON API documents from your request-specs.
|
@@ -250,7 +250,6 @@ test_files:
|
|
250
250
|
- spec/dummy/public/500.html
|
251
251
|
- spec/dummy/public/favicon.ico
|
252
252
|
- spec/dummy/script/rails
|
253
|
-
- spec/dummy/spec
|
254
253
|
- spec/requests/admin/entries_spec.rb
|
255
254
|
- spec/requests/entries_spec.rb
|
256
255
|
- spec/requests/pending_spec.rb
|
data/spec/dummy/spec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
spec/dummy/../../spec
|