metanorma-utils 2.0.12 → 2.0.13

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: 0c1e1dcd39f422719231a463baad92a7cfb2774836497b5b862c9baa1bf457f1
4
- data.tar.gz: a665005b573ead115c5304f1ddaa675070dd73b5563e120046610133fa3f2690
3
+ metadata.gz: 9d4e103c2007a8606321ab43dc5a8519171f79f86715d3738924f1a8bb6618eb
4
+ data.tar.gz: 14d3c67f8f120d14bfc78429a120483a4b33fd673bf7ff78b22877304088c15a
5
5
  SHA512:
6
- metadata.gz: 35ab1ff450498d18369cb240313c830347a8d90dee2c6a690341901ddc6bf00f64fe2797501df48777d0858b5ee409ee91d1a98842048bcd56de07807749625c
7
- data.tar.gz: 15e6daaa1c5c2a8db6ae670d0f045465f65fa001e24632592515b31ca71cd4149eb1f03082272df45104b333f64bff7172518ae8ed4781ef0e6bf9d91faffedc
6
+ metadata.gz: 3019a763cf0400d5524323ff053c4042e348443c0923708fda95fab69dda2037b1800ce9156d17ff5d8ca3240d0489e3ea8dc67b281db0477a3d266dc111cbb0
7
+ data.tar.gz: cdcb5d20850148e2ee68d184a4cdb5a48122f65727ca9e883c08a7b27b02636a68814f1cdd623d883d632e2e7b32f484044142753e860e6ab85d0e0ba1db2d49
@@ -8,6 +8,7 @@ require_relative "utils/xml"
8
8
  require_relative "utils/anchor"
9
9
  require_relative "utils/anchor_ranges"
10
10
  require_relative "utils/random_uuid"
11
+ require_relative "utils/stable_uuid"
11
12
  require_relative "utils/htmlentities_patch"
12
13
  require_relative "utils/gc_budget"
13
14
  require_relative "utils/asciidoctor_table_buffer"
@@ -0,0 +1,24 @@
1
+ require "uuidtools"
2
+
3
+ module Metanorma
4
+ module Utils
5
+ # Namespace for the deterministic identifier mint: the same name
6
+ # always produces the same UUIDv5.
7
+ STABLE_UUID_NAMESPACE = UUIDTools::UUID.parse_raw(
8
+ [0x8d, 0x3c, 0x51, 0x93, 0x9e, 0x0c, 0x4f, 0x4d, 0x9c, 0xa3,
9
+ 0x71, 0x9c, 0x2b, 0x4f, 0x3e, 0xd2].pack("C*")
10
+ )
11
+
12
+ class << self
13
+ # A deterministic identifier: the same parts always produce the
14
+ # same UUID. Recompiling a document must produce the same
15
+ # element ids (isodoc#861 - the random mint made every compile's
16
+ # HTML differ).
17
+ def stable_uuid(*parts)
18
+ UUIDTools::UUID
19
+ .sha1_create(STABLE_UUID_NAMESPACE, parts.compact.join("\0"))
20
+ .to_s
21
+ end
22
+ end
23
+ end
24
+ end
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "2.0.12".freeze
3
+ VERSION = "2.0.13".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-12 00:00:00.000000000 Z
11
+ date: 2026-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -320,6 +320,7 @@ files:
320
320
  - lib/utils/main.rb
321
321
  - lib/utils/namespace.rb
322
322
  - lib/utils/random_uuid.rb
323
+ - lib/utils/stable_uuid.rb
323
324
  - lib/utils/version.rb
324
325
  - lib/utils/xml.rb
325
326
  - metanorma-utils.gemspec