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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c331c83dbf3382e68590173ba797cba15b9fc97c880467795c3febbf95c4292f
4
- data.tar.gz: d39fe375c581115f2bcbc59eca69801e83865b7dc7d2d0fefc36997815640819
3
+ metadata.gz: d5161adfcf9f143509658ed5c99dbc2e3721204d16c4e98769e0cb8fbc486c7e
4
+ data.tar.gz: 02b20891db27c19cec0ed8cd4c4357ec17525c0b915524a94416b4c8170edeb3
5
5
  SHA512:
6
- metadata.gz: c75b7b5d22eeccf6666ef2798de8380978bc86b0bc2a373e58b392108f284c6ee9d5e7207395c8a4ec751f0d2358d931307606b9ef52cc8d379d9084caf72224
7
- data.tar.gz: 7f7050cb83fc7ccb1b44cbf4186a6e277a6677333ccd06cb845b395118b0be27138eb5436e8b28cef545c08f39391b16da15ab43dcd770267a93aea33e64cb3d
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
@@ -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.16"
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.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-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