suma 0.5.14 → 0.5.15

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: c331c83dbf3382e68590173ba797cba15b9fc97c880467795c3febbf95c4292f
4
- data.tar.gz: d39fe375c581115f2bcbc59eca69801e83865b7dc7d2d0fefc36997815640819
3
+ metadata.gz: e4e9d6b489b68d471befb51316694e2f84e400b891840861035d68fca951d5e9
4
+ data.tar.gz: 11d272b589da8fb0481487f25163a7c38840ede0ad4c26e094aa63133d6689b3
5
5
  SHA512:
6
- metadata.gz: c75b7b5d22eeccf6666ef2798de8380978bc86b0bc2a373e58b392108f284c6ee9d5e7207395c8a4ec751f0d2358d931307606b9ef52cc8d379d9084caf72224
7
- data.tar.gz: 7f7050cb83fc7ccb1b44cbf4186a6e277a6677333ccd06cb845b395118b0be27138eb5436e8b28cef545c08f39391b16da15ab43dcd770267a93aea33e64cb3d
6
+ metadata.gz: 8e3d3dfffd94269601f12d229584a842a2056e09792dc3955a24ac5788b0fbbd2fbbdcc1d67566c43c4bb72e863682557f7ab833feae3344cf1ca3dea92b5951
7
+ data.tar.gz: 12af99d3250d9fd0f9f342b7afead52e13f2d10715089908c0a59f3b59ce9c155f6842e5490d4db15b57dc938becd91cf0b3a058e55a9d45d86f3b2a105e5a4c
@@ -168,6 +168,18 @@ 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
+ member_id = manifest.dig("manifest", "docref", 0, "identifier")
178
+ id_slug = member_id.to_s
179
+ .gsub(/[^A-Za-z0-9._-]+/, "-").gsub(/-{2,}/, "-")
180
+ .gsub(/\A-|-\z/, "")
181
+ semantics_before = Dir.children(store_dir)
182
+ .select { |f| f.end_with?(".semantic.xml") }
171
183
  compile = { install_fonts: false }
172
184
  compile[:novalid] = true if no_valid == "1"
173
185
  Metanorma::Collection.parse(one_path).render(
@@ -175,6 +187,18 @@ module Suma
175
187
  preserve_unresolved: true, artifact_store_dir: store_dir,
176
188
  compile: compile,
177
189
  )
190
+ unless id_slug.empty?
191
+ produced = Dir.children(store_dir).select do |f|
192
+ f.end_with?(".semantic.xml")
193
+ end - semantics_before
194
+ produced.each do |f|
195
+ if (m = f.match(/\A(.*).([0-9a-f]+).semantic.xml\z/))
196
+ alias_name = "\#{id_slug}.\#{m[2]}.semantic.xml"
197
+ alias_path = File.join(store_dir, alias_name)
198
+ FileUtils.cp(File.join(store_dir, f), alias_path)
199
+ end
200
+ end
201
+ end
178
202
  warn format("[staged worker %d] batch %d/%d member %d OK (%ds)",
179
203
  Process.pid, idx + 1, count, j, Time.now - t0)
180
204
  ensure
data/lib/suma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Suma
4
- VERSION = "0.5.14"
4
+ VERSION = "0.5.15"
5
5
  end
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.14
4
+ version: 0.5.15
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-30 00:00:00.000000000 Z
11
+ date: 2026-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir