dox 2.0.0 → 2.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
  SHA256:
3
- metadata.gz: c4cb190cdb908fc6f132913d43624c470ab3f495f8875fdf9b8fb311f7d9dc15
4
- data.tar.gz: cd95ecb21307695857b2164834703c1cc2fcee8f2675721054fdde257f6b4fbf
3
+ metadata.gz: 6ac14990e1aed86a15afdb17c5c35ad6ac8a53f77048b6b1603b60b33aef6525
4
+ data.tar.gz: d3b39910094b5bbb713a9955846484a191490e4679cb342e944ddcfd97485613
5
5
  SHA512:
6
- metadata.gz: 3c6f7b2b5497fca67e55b06fa037b0c677c4d6ec552fc117674f25b46bbb30aed430bf3290e951a2fa66b32a8280629953f341f8a3c62e76308be4145855ac0d
7
- data.tar.gz: e8204b56a371f816da95cd240f52f04d30f6d46346111fb35ea393337c07ebdd9a3abe04190e52014613ec411efcaafcd31d2aeb094759a7b8fcf4e551b0708e
6
+ metadata.gz: d38a2f5c4a68bdc79ee57242008ec9b5d838478c75788404b83cabaa1faf886479495eeefaab182288a020a2b3bda5b7c800e2dcc82161b69a50ff23d5bef72d
7
+ data.tar.gz: 3d1f9d58ea318955a97cc1dccd6d6fa79bcf622b169e5d198a6dde5c3e1b97fdfa15dc36f4d3ada5393de72a43508b794ba69d95f75e8627836b2cb83f731e01
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.5
1
+ 2.6.7
data/CHANGELOG.md ADDED
@@ -0,0 +1,146 @@
1
+ # Changelog
2
+
3
+ ## v2.2.0 (2022-11-03)
4
+
5
+ ### Enhancements
6
+
7
+ - Prepare dox for Rails 7.1 - Start using `#media_type` on request and response objects (removes following deprecation message):
8
+
9
+ ```bash
10
+ DEPRECATION WARNING: Rails 7.1 will return Content-Type header without modification. If you want just the MIME type, please use `#media_type` instead.
11
+ ```
12
+
13
+ ## v2.1.0 (2021-03-26)
14
+
15
+ ### Enhancements
16
+
17
+ - Added 'activesupport' as a runtime dependency
18
+ - Dropped 'rails' as a runtime dependency
19
+
20
+
21
+ ## v2.0.0 (2020-08-08)
22
+
23
+ ### Enhancements
24
+
25
+ - Added `Dox.config.title`
26
+ - Added `Dox.config.header_description`
27
+ - Added `Dox.config.version`
28
+
29
+
30
+ ### Breaking changes / Deprecations
31
+
32
+ - [BREAKING] The API description format changed from API-blueprint to OpenAPI.
33
+ - [BREAKING] Base structure is now defined in .json format
34
+ - [BREAKING] Output is written to a .json file
35
+ - [BREAKING] Html is rendered with Redoc instead of Aglio
36
+ - [BREAKING] Renamed `Dox.config.desc_folder_path` -> `Dox.config.descriptions_location`
37
+ - [BREAKING] Removed `endpoint` method from document resource block
38
+ - [DEPRECATED] `Dox.config.header_file_path`
39
+
40
+
41
+ ## v1.3.0 (2021-03-26)
42
+
43
+ ### Enhancements
44
+
45
+ - Added 'activesupport' as a runtime dependency
46
+ - Dropped 'rails' as a runtime dependency
47
+
48
+
49
+ ## v1.2.0 (2019-11-27)
50
+
51
+ ### Enhancements
52
+
53
+ - Support Multipart payload with pretty formatting (based on `content-type` header)
54
+
55
+
56
+ ### Bugfixes
57
+
58
+ - Explicit passing of an empty hash for `params` in actions now works as expected
59
+
60
+
61
+ ## v1.1.0 (2018-02-19)
62
+
63
+ ### Enhancements
64
+
65
+ - Full RSpec failure dump to stderr if any test fails when running tests with Dox::Formatter
66
+ - Support any payload format with pretty formatting for JSON and XML (based on `content-type` header)
67
+
68
+
69
+ ### Bugfixes
70
+
71
+ - Ignore subdomain request header in headers output
72
+
73
+
74
+ ## v1.0.2 (2017-06-10)
75
+
76
+ ### Enhancements
77
+
78
+ - Set minimal Ruby version to 2.x
79
+
80
+
81
+ ### Bugfixes
82
+
83
+ - Fixed parsing blank request body string
84
+
85
+
86
+ ## v1.0.1 (2017-06-10)
87
+
88
+ ### Enhancements
89
+
90
+ - Add Rake tasks for generating documentation to Readme
91
+
92
+
93
+ ### Bugfixes
94
+
95
+ - Fix printing request body for test examples
96
+
97
+
98
+ ## v1.0.0 (2017-05-06)
99
+
100
+ ### Enhancements
101
+
102
+ - Guess path params for URI definition from example's request object
103
+ - Validate HTTP verbs specified in the descriptors' actions
104
+ - Document only examples whitelisted with `dox` tag
105
+ - Added option for whitelisting additional HTTP headers for examples
106
+ - Show request HTTP verb and fullpath for each action request
107
+ - Dox executable
108
+
109
+
110
+ ### Bugfixes
111
+
112
+ - Ignore body in query params (Rails 4 issue) for example request URL
113
+ - Pull request and response objects from example metadata
114
+
115
+
116
+ ## v1.0.0.alpha (2016-10-18)
117
+
118
+ ### Enhancements
119
+
120
+ - Updated the dependencies
121
+ - `extend Dox::DSL::Syntax` instead of `include Dox::DSL::Syntax` in descriptors
122
+
123
+
124
+ ### Breaking changes / Deprecations
125
+
126
+ - [BREAKING] Raise errors on missing required dox attributes in descriptors
127
+
128
+
129
+ ## v0.0.3 (2016-06-22)
130
+
131
+ ### Bugfixes
132
+
133
+ - Fixed example identifier for examples with query params
134
+
135
+
136
+ ## v0.0.2 (2016-06-14)
137
+
138
+ ### Enhancements
139
+
140
+ - Created core classes and a DSL for manipulating the examples in specs
141
+ - Added usage to readme
142
+
143
+
144
+ ## v0.0.1 (2016-06-06)
145
+
146
+ - First release of the dox gem where the initial gem skeleton has been created
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ gemspec
5
5
 
6
6
  rails_version = ENV['RAILS_VERSION'] || '6.0.2'
7
7
 
8
- gem 'rails', "~> #{rails_version}"
8
+ gem 'activesupport', "~> #{rails_version}"
data/dox.gemspec CHANGED
@@ -25,13 +25,13 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ['lib']
27
27
 
28
+ spec.add_runtime_dependency 'activesupport', '>= 4.0'
28
29
  spec.add_development_dependency 'bundler'
29
30
  spec.add_development_dependency 'codeclimate-test-reporter'
30
31
  spec.add_development_dependency 'json'
31
32
  spec.add_development_dependency 'pry-nav'
32
33
  spec.add_development_dependency 'pry-rails'
33
34
  spec.add_development_dependency 'pry-stack_explorer'
34
- spec.add_runtime_dependency 'rails', '>= 4.0'
35
35
  spec.add_development_dependency 'rake'
36
36
  spec.add_development_dependency 'rspec', '~> 3.0'
37
37
  spec.add_development_dependency 'rubocop'
@@ -5,10 +5,8 @@ module Dox
5
5
 
6
6
  attr_reader :desc, :name, :request_schema, :response_schema_success, :response_schema_fail
7
7
 
8
- def_delegator :response, :status, :response_status
9
- def_delegator :response, :content_type, :response_content_type
10
- def_delegator :request, :content_type, :request_content_type
11
8
  def_delegator :request, :method, :request_method
9
+ def_delegator :response, :status, :response_status
12
10
 
13
11
  def initialize(details, request, response)
14
12
  @desc = details[:description]
@@ -53,6 +51,15 @@ module Dox
53
51
  end
54
52
  end
55
53
 
54
+ # Rails 7 changes content_type result
55
+ def request_content_type
56
+ request.respond_to?(:media_type) ? request.media_type : request.content_type
57
+ end
58
+
59
+ def response_content_type
60
+ response.respond_to?(:media_type) ? response.media_type : response.content_type
61
+ end
62
+
56
63
  private
57
64
 
58
65
  def format_content(http_env, content_type)
data/lib/dox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dox
2
- VERSION = '2.0.0'
2
+ VERSION = '2.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,32 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melita Kokot
8
8
  - Vedran Hrnčić
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-19 00:00:00.000000000 Z
12
+ date: 2022-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: bundler
15
+ name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :development
20
+ version: '4.0'
21
+ type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: '4.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: codeclimate-test-reporter
29
+ name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
@@ -40,7 +40,7 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: json
43
+ name: codeclimate-test-reporter
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -54,7 +54,7 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: pry-nav
57
+ name: json
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
@@ -68,7 +68,7 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
- name: pry-rails
71
+ name: pry-nav
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
@@ -82,7 +82,7 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
- name: pry-stack_explorer
85
+ name: pry-rails
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
@@ -96,19 +96,19 @@ dependencies:
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
- name: rails
99
+ name: pry-stack_explorer
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: '4.0'
105
- type: :runtime
104
+ version: '0'
105
+ type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
- version: '4.0'
111
+ version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: rake
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
- description:
182
+ description:
183
183
  email:
184
184
  - melita.kokot@gmail.com
185
185
  - vrabac266@gmail.com
@@ -193,7 +193,7 @@ files:
193
193
  - ".rubocop.yml"
194
194
  - ".ruby-version"
195
195
  - ".travis.yml"
196
- - CHANGES.md
196
+ - CHANGELOG.md
197
197
  - CODE_OF_CONDUCT.md
198
198
  - Gemfile
199
199
  - LICENSE.txt
@@ -241,7 +241,7 @@ licenses:
241
241
  - MIT
242
242
  metadata:
243
243
  allowed_push_host: https://rubygems.org
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.3
260
- signing_key:
259
+ rubygems_version: 3.0.3.1
260
+ signing_key:
261
261
  specification_version: 4
262
262
  summary: Generates API documentation for rspec in OpenAPI format.
263
263
  test_files: []
data/CHANGES.md DELETED
@@ -1,103 +0,0 @@
1
- # Changelog
2
-
3
- ## Version 2.0.0
4
-
5
- Released on August 8, 2020
6
-
7
- Change:
8
- - BREAKING CHANGE The API description format changed from API-blueprint to OpenAPI.
9
- - BREAKING CHANGE Base structure is now defined in .json format
10
- - BREAKING CHANGE Output is written to a .json file
11
- - BREAKING CHANGE Html is rendered with Redoc instead of Aglio
12
- - Renamed `Dox.config.desc_folder_path` -> `Dox.config.descriptions_location`
13
- - Depricated `Dox.config.header_file_path`
14
- - Removed `endpoint` method from document resource block
15
-
16
- New:
17
- - Added `Dox.config.title`
18
- - Added `Dox.config.header_description`
19
- - Added `Dox.config.version`
20
-
21
- ## Version 1.2.0
22
-
23
- Released on November 27, 2019
24
-
25
- New:
26
- - Support Multipart payload with pretty formatting (based on `content-type` header)
27
-
28
- Fix:
29
- - Explicit passing of an empty hash for `params` in actions now works as expected
30
-
31
-
32
- ## Version 1.1.0
33
-
34
- Released on February 19, 2018
35
-
36
- New:
37
- - Full RSpec failure dump to stderr if any test fails when running tests with Dox::Formatter
38
- - Support any payload format with pretty formatting for JSON and XML (based on `content-type` header)
39
-
40
- Fix:
41
- - Ignore subdomain request header in headers output
42
-
43
-
44
- ## Version 1.0.1
45
-
46
- Released on June 10, 2017
47
-
48
- New:
49
- - Add Rake tasks for generating documentation to Readme
50
-
51
- Fix:
52
- - Fix printing request body for test examples
53
-
54
-
55
- ## Version 1.0.0
56
-
57
- Released on May 6, 2017
58
-
59
- New:
60
- - Guess path params for URI definition from example's request object
61
- - Validate HTTP verbs specified in the descriptors' actions
62
- - Document only examples whitelisted with `dox` tag
63
- - Added option for whitelisting additional HTTP headers for examples
64
- - Show request HTTP verb and fullpath for each action request
65
- - Dox executable
66
-
67
- Fix:
68
- - Ignore body in query params (Rails 4 issue) for example request URL
69
- - Pull request and response objects from example metadata
70
-
71
- ## Version 1.0.0.alpha
72
-
73
- Released on October 18, 2016
74
-
75
- - Updated the dependencies
76
-
77
- New:
78
- - Raise errors on missing required dox attributes in descriptors
79
- - `extend Dox::DSL::Syntax` instead of `include Dox::DSL::Syntax` in descriptors
80
-
81
-
82
- ## Version 0.0.3
83
-
84
- Released on June 22, 2016
85
-
86
- Fix:
87
- - Fixed example identifier for examples with query params
88
-
89
-
90
- ## Version 0.0.2
91
-
92
-
93
- Released on June 14, 2016
94
-
95
- - Created core classes and a DSL for manipulating the examples in specs
96
- - Added usage to readme
97
-
98
-
99
- ## Version 0.0.1
100
-
101
- Released on June 06, 2016
102
-
103
- - First release of the dox gem where the initial gem skeleton has been created