dox 2.3.0 → 2.4.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/dox/dsl/resource.rb +9 -0
- data/lib/dox/printers/base_printer.rb +2 -7
- data/lib/dox/util/file.rb +18 -0
- data/lib/dox/version.rb +1 -1
- data/lib/dox.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28307d7bc11d4b35d5951f89c855b98af58877cb956a8f638a8541b9358d239d
|
4
|
+
data.tar.gz: 62e8c8228e9390adc964fce294ea2c83017a1da64de73d959d30588e22010317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05cc87faaf0602cb9f01bc3cf72ad7d4a98c3db5a331bad7380746f515eeea67f5143763f31107cb3d5aa44a884a62206f669138c0901f01090dcd4930a3199e
|
7
|
+
data.tar.gz: 85bce8dbc8b87d9244db98d449c01e7b26fce507bcdbf1eafaa454c6f554a8562bb68d5e1d949bb28f7b3dc5ac62dfc1f50b246f1619e09a36cf8d1d99aa8929
|
data/CHANGELOG.md
CHANGED
data/lib/dox/dsl/resource.rb
CHANGED
@@ -16,6 +16,7 @@ module Dox
|
|
16
16
|
|
17
17
|
raise(Dox::Errors::InvalidResourceError, 'Resource name is required!') if @name.blank?
|
18
18
|
raise(Dox::Errors::InvalidResourceError, 'Resource group is required!') if @group.blank?
|
19
|
+
raise(Dox::Errors::InvalidResourceError, "Resource desc #{@desc} is missing!") if desc_file_path.nil?
|
19
20
|
end
|
20
21
|
|
21
22
|
def config
|
@@ -26,6 +27,14 @@ module Dox
|
|
26
27
|
apidoc: true
|
27
28
|
}
|
28
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def desc_file_path
|
34
|
+
return true if @desc.nil? || !@desc.end_with?('.md')
|
35
|
+
|
36
|
+
Util::File.file_path(@desc).presence
|
37
|
+
end
|
29
38
|
end
|
30
39
|
end
|
31
40
|
end
|
@@ -20,14 +20,9 @@ module Dox
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def read_file(path, config_root_path: Dox.config.descriptions_location)
|
23
|
-
|
23
|
+
full_path = Util::File.file_path(path, config_root_path: config_root_path)
|
24
24
|
|
25
|
-
|
26
|
-
file_path = File.join(root_path, path)
|
27
|
-
next unless File.exist?(file_path)
|
28
|
-
|
29
|
-
return File.read(file_path)
|
30
|
-
end
|
25
|
+
full_path.nil? ? nil : File.read(full_path)
|
31
26
|
end
|
32
27
|
|
33
28
|
def formatted_body(body_str, content_type)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Dox
|
2
|
+
module Util
|
3
|
+
module File
|
4
|
+
def self.file_path(path, config_root_path: Dox.config.descriptions_location)
|
5
|
+
return '' unless config_root_path
|
6
|
+
|
7
|
+
config_root_path.each do |root_path|
|
8
|
+
full_path = ::File.join(root_path, path)
|
9
|
+
next unless ::File.exist?(full_path)
|
10
|
+
|
11
|
+
return full_path
|
12
|
+
end
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/dox/version.rb
CHANGED
data/lib/dox.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.4.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: 2024-
|
12
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/dox/printers/example_response_printer.rb
|
235
235
|
- lib/dox/printers/resource_group_printer.rb
|
236
236
|
- lib/dox/printers/resource_printer.rb
|
237
|
+
- lib/dox/util/file.rb
|
237
238
|
- lib/dox/util/http.rb
|
238
239
|
- lib/dox/version.rb
|
239
240
|
homepage: https://github.com/infinum/dox
|