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 +4 -4
- data/lib/metanorma-utils.rb +1 -0
- data/lib/utils/stable_uuid.rb +24 -0
- data/lib/utils/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d4e103c2007a8606321ab43dc5a8519171f79f86715d3738924f1a8bb6618eb
|
|
4
|
+
data.tar.gz: 14d3c67f8f120d14bfc78429a120483a4b33fd673bf7ff78b22877304088c15a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3019a763cf0400d5524323ff053c4042e348443c0923708fda95fab69dda2037b1800ce9156d17ff5d8ca3240d0489e3ea8dc67b281db0477a3d266dc111cbb0
|
|
7
|
+
data.tar.gz: cdcb5d20850148e2ee68d184a4cdb5a48122f65727ca9e883c08a7b27b02636a68814f1cdd623d883d632e2e7b32f484044142753e860e6ab85d0e0ba1db2d49
|
data/lib/metanorma-utils.rb
CHANGED
|
@@ -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
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.
|
|
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-
|
|
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
|