metanorma-plugin-plantuml 1.0.8 → 1.0.9
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1594b7a7a379d41a955dc64c9df45f279e97dcc70e945c8cdd71f24a8dead0de
|
|
4
|
+
data.tar.gz: b7e1d1f1743f13bba5b73bf903cf38711fc6f4e76d68faaa16c1efcd164922ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6407c49cb09ad07891238d922fe34f61b876d4be22cf388ebd0a281a6264eade533b0a0b710213d1a936eabc63b97dd88cdc71e34e83922d46169b5392a6397d
|
|
7
|
+
data.tar.gz: f7986cd4458b65f5b4d0040080880c86e101082843dbf9cbc85e5ec18b6292ee4730a2c2feed97a7aa4190f395d3f6107ae873e4c61e45381f82c7696ce333b8
|
|
@@ -70,9 +70,20 @@ module Metanorma
|
|
|
70
70
|
through_attrs
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
def generate_file_prep(parent)
|
|
73
|
+
def generate_file_prep(parent) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
74
|
+
imagesdir = if parent.document.attr("docfile") &&
|
|
75
|
+
parent.document.attr("imagesdir")
|
|
76
|
+
File.expand_path(
|
|
77
|
+
File.join(
|
|
78
|
+
File.dirname(parent.document.attr("docfile")),
|
|
79
|
+
parent.document.attr("imagesdir"),
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
else
|
|
83
|
+
parent.document.attr("imagesdir")
|
|
84
|
+
end
|
|
85
|
+
|
|
74
86
|
ldir = localdir(parent)
|
|
75
|
-
imagesdir = parent.document.attr("imagesdir")
|
|
76
87
|
fmt = parent.document
|
|
77
88
|
.attr("plantuml-image-format")&.strip&.downcase ||
|
|
78
89
|
Wrapper::DEFAULT_FORMAT
|
|
@@ -86,12 +97,25 @@ module Metanorma
|
|
|
86
97
|
raise "Destination directory #{ret} not writable for PlantUML!"
|
|
87
98
|
end
|
|
88
99
|
|
|
89
|
-
def path_prep(localdir, imagesdir)
|
|
90
|
-
|
|
91
|
-
sourcepath = imagesdir
|
|
100
|
+
def path_prep(localdir, imagesdir) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
101
|
+
# Determine source path
|
|
102
|
+
sourcepath = if imagesdir.nil?
|
|
103
|
+
localdir
|
|
104
|
+
elsif Pathname.new(imagesdir).absolute?
|
|
105
|
+
imagesdir
|
|
106
|
+
else
|
|
107
|
+
File.join(localdir, imagesdir)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Determine PlantUML images destination absolute path
|
|
111
|
+
path = Pathname.new(
|
|
112
|
+
File.expand_path(File.join(localdir, "_plantuml_images")),
|
|
113
|
+
)
|
|
92
114
|
path.mkpath
|
|
93
115
|
|
|
94
|
-
|
|
116
|
+
unless File.writable?(path)
|
|
117
|
+
raise "Destination path #{path} not writable for PlantUML!"
|
|
118
|
+
end
|
|
95
119
|
|
|
96
120
|
[
|
|
97
121
|
path,
|
|
@@ -9,9 +9,13 @@ module Metanorma
|
|
|
9
9
|
module Utils
|
|
10
10
|
class << self
|
|
11
11
|
def localdir(document)
|
|
12
|
-
document.attributes["
|
|
12
|
+
if document.attributes["docfile"]
|
|
13
|
+
File.dirname(document.attributes["docfile"])
|
|
14
|
+
else
|
|
13
15
|
document.attributes["docdir"] ||
|
|
14
|
-
|
|
16
|
+
document.attributes["localdir"] ||
|
|
17
|
+
File.dirname(".")
|
|
18
|
+
end
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-plugin-plantuml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|