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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ac14990e1aed86a15afdb17c5c35ad6ac8a53f77048b6b1603b60b33aef6525
4
- data.tar.gz: d3b39910094b5bbb713a9955846484a191490e4679cb342e944ddcfd97485613
3
+ metadata.gz: 6a1fcae5e0c58ef6689eaede57da79f082f2207d6da123f5251d994deafbca75
4
+ data.tar.gz: 9a76f7f7e8be9312d3b3e509d1acec8d9fd39aa6e4004e3a1f9f2b2475005c61
5
5
  SHA512:
6
- metadata.gz: d38a2f5c4a68bdc79ee57242008ec9b5d838478c75788404b83cabaa1faf886479495eeefaab182288a020a2b3bda5b7c800e2dcc82161b69a50ff23d5bef72d
7
- data.tar.gz: 3d1f9d58ea318955a97cc1dccd6d6fa79bcf622b169e5d198a6dde5c3e1b97fdfa15dc36f4d3ada5393de72a43508b794ba69d95f75e8627836b2cb83f731e01
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
- raise(Errors::FolderNotFoundError, folder_path) unless Dir.exist?(folder_path)
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, root_path: Dox.config.descriptions_location)
23
- return '' unless root_path
22
+ def read_file(path, config_root_path: Dox.config.descriptions_location)
23
+ return '' unless config_root_path
24
24
 
25
- File.read(File.join(root_path, path))
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
@@ -1,3 +1,3 @@
1
1
  module Dox
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.3.0'.freeze
3
3
  end
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.2.0
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: 2022-11-03 00:00:00.000000000 Z
12
+ date: 2024-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport