dox 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/dox/config.rb +4 -2
- data/lib/dox/printers/base_printer.rb +8 -3
- data/lib/dox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a1fcae5e0c58ef6689eaede57da79f082f2207d6da123f5251d994deafbca75
|
4
|
+
data.tar.gz: 9a76f7f7e8be9312d3b3e509d1acec8d9fd39aa6e4004e3a1f9f2b2475005c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9713ae85d917e7fac673c5e3d78bf2ba3a9c04d943373b98c13c47b67dde4bf53fe5e1eec49117f919a22286120b9ffdcb47eed4bb749ff44661a039a326285d
|
7
|
+
data.tar.gz: 18c023ed7556dd63095d7473d858ea577a38e75a507830359a41ef4303ac29f0690e40a3f4aa1ab63dd3d5b5321adc58262b3ac67c1a70e16d20cf84c029fd6c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v2.3.0 (2024-02-20)
|
4
|
+
|
5
|
+
### Enhancements
|
6
|
+
|
7
|
+
- Enable `#descriptions_location` config to be an array of pathname instances or fullpath strings, which will make dox search resource descriptions in more folders, not just one
|
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
|
+
|
3
13
|
## v2.2.0 (2022-11-03)
|
4
14
|
|
5
15
|
### Enhancements
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ Set these optional options in the rails_helper:
|
|
45
45
|
|
46
46
|
| Option | Value | Description |
|
47
47
|
| -- | -- | -- |
|
48
|
-
| descriptions_location | Pathname instance or fullpath string | Folder containing markdown descriptions of resources. |
|
48
|
+
| descriptions_location | Pathname instance or fullpath string (can be an array) | Folder containing markdown descriptions of resources. |
|
49
49
|
| schema_request_folder_path | Pathname instance or fullpath string | Folder with request schemas of resources. |
|
50
50
|
| schema_response_folder_path | Pathname instance or fullpath string | Folder with response schemas of resources. |
|
51
51
|
| schema_response_fail_file_path | Pathname instance or fullpath string | Json file that contains the default schema of a failed response. |
|
data/lib/dox/config.rb
CHANGED
@@ -12,9 +12,11 @@ module Dox
|
|
12
12
|
attr_reader :descriptions_location
|
13
13
|
|
14
14
|
def descriptions_location=(folder_path)
|
15
|
-
|
15
|
+
Array(folder_path).each do |path|
|
16
|
+
raise(Errors::FolderNotFoundError, path) unless Dir.exist?(path)
|
17
|
+
end
|
16
18
|
|
17
|
-
@descriptions_location = folder_path
|
19
|
+
@descriptions_location = Array(folder_path)
|
18
20
|
end
|
19
21
|
|
20
22
|
def schema_request_folder_path=(folder_path)
|
@@ -19,10 +19,15 @@ module Dox
|
|
19
19
|
hash[key] = default
|
20
20
|
end
|
21
21
|
|
22
|
-
def read_file(path,
|
23
|
-
return '' unless
|
22
|
+
def read_file(path, config_root_path: Dox.config.descriptions_location)
|
23
|
+
return '' unless config_root_path
|
24
24
|
|
25
|
-
|
25
|
+
config_root_path.each do |root_path|
|
26
|
+
file_path = File.join(root_path, path)
|
27
|
+
next unless File.exist?(file_path)
|
28
|
+
|
29
|
+
return File.read(file_path)
|
30
|
+
end
|
26
31
|
end
|
27
32
|
|
28
33
|
def formatted_body(body_str, content_type)
|
data/lib/dox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Melita Kokot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|