suma 0.5.14 → 0.5.16
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/lib/suma/staged_collection_builder.rb +26 -0
- data/lib/suma/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: d5161adfcf9f143509658ed5c99dbc2e3721204d16c4e98769e0cb8fbc486c7e
|
|
4
|
+
data.tar.gz: 02b20891db27c19cec0ed8cd4c4357ec17525c0b915524a94416b4c8170edeb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fec9c48ab684262c6b753e2900ed9ff884f4d34f18b5327887608cb37a01bde3a7e2ebb3675b552c52a730595c1d36baefc0409d095e186e2f889f312b463d18
|
|
7
|
+
data.tar.gz: 17ed78b1bff8d3efdaf40c205cea7c664abc03c2fb440c40291ec2f2a5919d1cba85b7c5eead1c9caa67b24534ec90a6d8f58db6588812a0eb19ba74712e1cc0
|
|
@@ -168,6 +168,20 @@ module Suma
|
|
|
168
168
|
t0 = Time.now
|
|
169
169
|
begin
|
|
170
170
|
File.write(one_path, YAML.dump(manifest))
|
|
171
|
+
# The artefact store keys on the rendered document's own
|
|
172
|
+
# docid, while the parent reinflates by the docref
|
|
173
|
+
# identifier; members whose document docid differs from the
|
|
174
|
+
# docref (docrefs carrying metanorma's GUID marker) were
|
|
175
|
+
# therefore unrecoverable ("no stored artefact"). Alias the
|
|
176
|
+
# artefacts this render produced under the docref slug too.
|
|
177
|
+
# Shape: single_member_manifest => {"manifest" =>
|
|
178
|
+
# {"manifest" => [{"docref" => [dr]}]}}.
|
|
179
|
+
member_id = manifest.dig("manifest", "manifest", 0, "docref", 0, "identifier")
|
|
180
|
+
id_slug = member_id.to_s
|
|
181
|
+
.gsub(/[^A-Za-z0-9._-]+/, "-").gsub(/-{2,}/, "-")
|
|
182
|
+
.gsub(/\A-|-\z/, "")
|
|
183
|
+
semantics_before = Dir.children(store_dir)
|
|
184
|
+
.select { |f| f.end_with?(".semantic.xml") }
|
|
171
185
|
compile = { install_fonts: false }
|
|
172
186
|
compile[:novalid] = true if no_valid == "1"
|
|
173
187
|
Metanorma::Collection.parse(one_path).render(
|
|
@@ -175,6 +189,18 @@ module Suma
|
|
|
175
189
|
preserve_unresolved: true, artifact_store_dir: store_dir,
|
|
176
190
|
compile: compile,
|
|
177
191
|
)
|
|
192
|
+
unless id_slug.empty?
|
|
193
|
+
produced = Dir.children(store_dir).select do |f|
|
|
194
|
+
f.end_with?(".semantic.xml")
|
|
195
|
+
end - semantics_before
|
|
196
|
+
produced.each do |f|
|
|
197
|
+
if (m = f.match(/\A(.*).([0-9a-f]+).semantic.xml\z/))
|
|
198
|
+
alias_name = "\#{id_slug}.\#{m[2]}.semantic.xml"
|
|
199
|
+
alias_path = File.join(store_dir, alias_name)
|
|
200
|
+
FileUtils.cp(File.join(store_dir, f), alias_path)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
178
204
|
warn format("[staged worker %d] batch %d/%d member %d OK (%ds)",
|
|
179
205
|
Process.pid, idx + 1, count, j, Time.now - t0)
|
|
180
206
|
ensure
|
data/lib/suma/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: suma
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: expressir
|