autodoc 0.7.4 → 0.7.7

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: b85a26f53e7fa2ebcf4f67b06233e19efc03c107355214b9b623af246a904ff5
4
- data.tar.gz: 5fae1862e5f8bcfd60babc419291cf6ed74bf9e658a0bb0c250a44352419a6a6
3
+ metadata.gz: 90d6e102506091c10a1fc1406473218b594323fed27e1e45bfef8f400ba68224
4
+ data.tar.gz: 6b849d38814134089c42761c74023c00d81f1fd42fd7605cebd6b3ab471288b8
5
5
  SHA512:
6
- metadata.gz: 18c63dcaa2adc9402ca25ec51d2d6a7ebebdbb058138214f1e6d3049a1fee60673f2e69bf95c5c09add3ec7aa812a47aecd42df5c6a64f30b1784861f488609d
7
- data.tar.gz: 8183e08791216d038607b6f5b615c58a9945ad8a586f0b6d77d1e5e2a9dd7ecd81554e4b32390c28eeb2602a04a0722856310cc232343e29b95cf572ad1d5631
6
+ metadata.gz: a5735483d6d426ca94f09f06b25fcba57d04d9e6c36fc430bea071c09aac59316184f7376525894a8e6b3b38957eabd64efec5dbcd20e1c3c7476af5059ebbc0
7
+ data.tar.gz: 32f6204f0a142cf6b503d2ac9e1ee0b1fc194235eaa18f00651903a33127a6e948b9a2af88ffa82b29d1a2beecf0ea8709d25031e3fd71af6d75e01e381ae68f
@@ -0,0 +1,28 @@
1
+ name: test
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby:
15
+ - 2.7.2
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - name: rails db:setup
24
+ run: |
25
+ cd spec/dummy
26
+ RAILS_ENV=test bundle exec rails db:setup
27
+ - name: Run the default task
28
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -7,8 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.7.7 - 2022-05-17
11
+
12
+ ### Fixed
13
+
14
+ - Prefer `#media_type` to `#content_type` (for Rails 7's change).
15
+ - Fix `ERB.new` arguments style.
16
+
17
+ ## 0.7.6 - 2021-04-22
18
+
19
+ ### Fixed
20
+
21
+ - Replace `URI.unescape` with `URI.decode_www_form_component` for Ruby 3 support.
22
+
23
+ ## 0.7.5 - 2021-02-16
24
+
25
+ ### Fixed
26
+
27
+ - Convert header key to string.
28
+
10
29
  ## 0.7.4 - 2020-04-14
11
30
 
31
+ ### Fixed
32
+
12
33
  - Improve error message on no request case.
13
34
 
14
35
  ## 0.7.3 - 2019-06-18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- autodoc (0.7.3)
4
+ autodoc (0.7.7)
5
5
  actionpack
6
6
  activesupport (>= 3.0.0)
7
7
  rspec
@@ -51,38 +51,41 @@ GEM
51
51
  minitest (~> 5.1)
52
52
  tzinfo (~> 1.1)
53
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)
54
+ builder (3.2.4)
55
+ coderay (1.1.3)
56
+ concurrent-ruby (1.1.10)
57
+ crass (1.0.6)
58
+ diff-lcs (1.5.0)
59
+ erubi (1.10.0)
60
+ globalid (1.0.0)
61
+ activesupport (>= 5.0)
62
+ i18n (1.10.0)
63
63
  concurrent-ruby (~> 1.0)
64
- loofah (2.3.1)
64
+ loofah (2.16.0)
65
65
  crass (~> 1.0.2)
66
66
  nokogiri (>= 1.5.9)
67
67
  mail (2.7.1)
68
68
  mini_mime (>= 0.1.1)
69
69
  marcel (0.3.3)
70
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.4.0)
75
- minitest (5.11.3)
76
- nio4r (2.3.1)
77
- nokogiri (1.10.8)
78
- mini_portile2 (~> 2.4.0)
79
- pry (0.10.4)
80
- coderay (~> 1.1.0)
81
- method_source (~> 0.8.1)
82
- slop (~> 3.4)
83
- pry-rails (0.3.6)
71
+ method_source (1.0.0)
72
+ mimemagic (0.3.10)
73
+ nokogiri (~> 1)
74
+ rake
75
+ mini_mime (1.1.2)
76
+ mini_portile2 (2.8.0)
77
+ minitest (5.15.0)
78
+ nio4r (2.5.8)
79
+ nokogiri (1.13.4)
80
+ mini_portile2 (~> 2.8.0)
81
+ racc (~> 1.4)
82
+ pry (0.14.1)
83
+ coderay (~> 1.1)
84
+ method_source (~> 1.0)
85
+ pry-rails (0.3.9)
84
86
  pry (>= 0.10.4)
85
- rack (2.0.8)
87
+ racc (1.6.0)
88
+ rack (2.2.3)
86
89
  rack-test (1.1.0)
87
90
  rack (>= 1.0, < 3)
88
91
  rails (5.2.2)
@@ -101,58 +104,57 @@ GEM
101
104
  rails-dom-testing (2.0.3)
102
105
  activesupport (>= 4.2.0)
103
106
  nokogiri (>= 1.6)
104
- rails-html-sanitizer (1.0.4)
105
- loofah (~> 2.2, >= 2.2.2)
107
+ rails-html-sanitizer (1.4.2)
108
+ loofah (~> 2.3)
106
109
  railties (5.2.2)
107
110
  actionpack (= 5.2.2)
108
111
  activesupport (= 5.2.2)
109
112
  method_source
110
113
  rake (>= 0.8.7)
111
114
  thor (>= 0.19.0, < 2.0)
112
- rake (13.0.1)
113
- redcarpet (3.4.0)
114
- responders (2.4.0)
115
- actionpack (>= 4.2.0, < 5.3)
116
- railties (>= 4.2.0, < 5.3)
117
- rspec (3.6.0)
118
- rspec-core (~> 3.6.0)
119
- rspec-expectations (~> 3.6.0)
120
- rspec-mocks (~> 3.6.0)
121
- rspec-core (3.6.0)
122
- rspec-support (~> 3.6.0)
123
- rspec-expectations (3.6.0)
115
+ rake (13.0.6)
116
+ redcarpet (3.5.1)
117
+ responders (3.0.1)
118
+ actionpack (>= 5.0)
119
+ railties (>= 5.0)
120
+ rspec (3.11.0)
121
+ rspec-core (~> 3.11.0)
122
+ rspec-expectations (~> 3.11.0)
123
+ rspec-mocks (~> 3.11.0)
124
+ rspec-core (3.11.0)
125
+ rspec-support (~> 3.11.0)
126
+ rspec-expectations (3.11.0)
124
127
  diff-lcs (>= 1.2.0, < 2.0)
125
- rspec-support (~> 3.6.0)
126
- rspec-mocks (3.6.0)
128
+ rspec-support (~> 3.11.0)
129
+ rspec-mocks (3.11.1)
127
130
  diff-lcs (>= 1.2.0, < 2.0)
128
- rspec-support (~> 3.6.0)
129
- rspec-rails (3.6.1)
130
- actionpack (>= 3.0)
131
- activesupport (>= 3.0)
132
- railties (>= 3.0)
133
- rspec-core (~> 3.6.0)
134
- rspec-expectations (~> 3.6.0)
135
- rspec-mocks (~> 3.6.0)
136
- rspec-support (~> 3.6.0)
137
- rspec-support (3.6.0)
138
- slop (3.6.0)
139
- sprockets (3.7.2)
131
+ rspec-support (~> 3.11.0)
132
+ rspec-rails (5.1.1)
133
+ actionpack (>= 5.2)
134
+ activesupport (>= 5.2)
135
+ railties (>= 5.2)
136
+ rspec-core (~> 3.10)
137
+ rspec-expectations (~> 3.10)
138
+ rspec-mocks (~> 3.10)
139
+ rspec-support (~> 3.10)
140
+ rspec-support (3.11.0)
141
+ sprockets (4.0.3)
140
142
  concurrent-ruby (~> 1.0)
141
143
  rack (> 1, < 3)
142
- sprockets-rails (3.2.1)
143
- actionpack (>= 4.0)
144
- activesupport (>= 4.0)
144
+ sprockets-rails (3.4.2)
145
+ actionpack (>= 5.2)
146
+ activesupport (>= 5.2)
145
147
  sprockets (>= 3.0.0)
146
148
  sqlite3 (1.3.13)
147
- thor (0.20.3)
149
+ thor (1.2.1)
148
150
  thread_safe (0.3.6)
149
- tzinfo (1.2.5)
151
+ tzinfo (1.2.9)
150
152
  thread_safe (~> 0.1)
151
- weak_parameters (0.4.2)
153
+ weak_parameters (0.5.0)
152
154
  rails (>= 4.0.0)
153
- websocket-driver (0.7.0)
155
+ websocket-driver (0.7.5)
154
156
  websocket-extensions (>= 0.1.0)
155
- websocket-extensions (0.1.3)
157
+ websocket-extensions (0.1.5)
156
158
 
157
159
  PLATFORMS
158
160
  ruby
@@ -167,7 +169,7 @@ DEPENDENCIES
167
169
  redcarpet
168
170
  responders
169
171
  rspec-rails
170
- sqlite3
172
+ sqlite3 (~> 1.3.13)
171
173
  weak_parameters
172
174
 
173
175
  BUNDLED WITH
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Autodoc
2
2
 
3
- [![CircleCI](https://circleci.com/gh/r7kamura/autodoc.svg?style=svg)](https://circleci.com/gh/r7kamura/autodoc)
3
+ [![test](https://github.com/r7kamura/autodoc/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/autodoc/actions/workflows/test.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/autodoc.svg)](https://rubygems.org/gems/autodoc)
5
5
 
6
6
  Generate documentation from your rack application & request-spec.
@@ -17,7 +17,7 @@ gem "redcarpet", group: :test
17
17
  ```
18
18
 
19
19
  ## Usage
20
- Run rspec with AUTODOC=1 to generate documents for your request-specs tagged with `:autodoc`.
20
+ Run rspec with AUTODOC=1 to generate documents for your request-specs tagged with `:autodoc`.
21
21
  example: Autodoc generates [doc/recipes.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/recipes.md) and [doc/toc.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/toc.md) from [spec/requests/recipes_spec.rb](https://github.com/r7kamura/autodoc/blob/master/spec/requests/recipes_spec.rb).
22
22
 
23
23
  ```sh
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
- require "bundler/gem_tasks"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: %i[spec]
data/autodoc.gemspec CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rails", "5.2.2"
25
25
  spec.add_development_dependency "rake"
26
- spec.add_development_dependency "sqlite3"
26
+ spec.add_development_dependency "sqlite3", "~> 1.3.13"
27
27
  end
@@ -27,7 +27,7 @@ module Autodoc
27
27
  end
28
28
 
29
29
  def render
30
- ERB.new(Autodoc.configuration.template, nil, "-").result(binding)
30
+ ERB.new(Autodoc.configuration.template, trim_mode: "-").result(binding)
31
31
  end
32
32
 
33
33
  def title
@@ -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.unescape(request.query_string.force_encoding(Encoding::UTF_8))}" unless request.query_string.empty?
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
@@ -119,7 +119,7 @@ module Autodoc
119
119
  else
120
120
  @request_body = begin
121
121
  case
122
- when request.try(:content_type) == "multipart/form-data"
122
+ when request.try(:media_type) == "multipart/form-data"
123
123
  "multipart/form-data"
124
124
  when request.headers["Content-Type"].try(:include?, "application/json")
125
125
  request_body_parsed_as_json
@@ -33,7 +33,7 @@ module Autodoc
33
33
  end
34
34
 
35
35
  def render_toc
36
- ERB.new(Autodoc.configuration.toc_template, nil, "-").result(binding)
36
+ ERB.new(Autodoc.configuration.toc_template, trim_mode: "-").result(binding)
37
37
  end
38
38
 
39
39
  def write_toc_html
@@ -42,7 +42,7 @@ module Autodoc
42
42
  end
43
43
 
44
44
  def render_toc_html
45
- ERB.new(Autodoc.configuration.toc_html_template, nil, "-").result(binding)
45
+ ERB.new(Autodoc.configuration.toc_html_template, trim_mode: "-").result(binding)
46
46
  end
47
47
 
48
48
  def toc_path
@@ -1,3 +1,3 @@
1
1
  module Autodoc
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.7"
3
3
  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
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2022-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: sqlite3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.13
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 1.3.13
111
111
  description:
112
112
  email:
113
113
  - r7kamura@gmail.com
@@ -115,7 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".circleci/config.yml"
118
+ - ".github/workflows/test.yml"
119
119
  - ".gitignore"
120
120
  - CHANGELOG.md
121
121
  - Gemfile
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
203
  requirements: []
204
- rubygems_version: 3.0.3
204
+ rubygems_version: 3.1.6
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Auto-generate JSON API documents from your request-specs.
data/.circleci/config.yml DELETED
@@ -1,29 +0,0 @@
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