metanorma-utils 2.0.13 → 2.0.14

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: 9d4e103c2007a8606321ab43dc5a8519171f79f86715d3738924f1a8bb6618eb
4
- data.tar.gz: 14d3c67f8f120d14bfc78429a120483a4b33fd673bf7ff78b22877304088c15a
3
+ metadata.gz: 2d02c080014b8cabcfeaa0e9ed6c6aaa0c3eaa2f577785ff2fff1f0e2a38f4e9
4
+ data.tar.gz: d02010244c01b3c5f08575ff928a00a947cafc36389410632c5f21adccb7e215
5
5
  SHA512:
6
- metadata.gz: 3019a763cf0400d5524323ff053c4042e348443c0923708fda95fab69dda2037b1800ce9156d17ff5d8ca3240d0489e3ea8dc67b281db0477a3d266dc111cbb0
7
- data.tar.gz: cdcb5d20850148e2ee68d184a4cdb5a48122f65727ca9e883c08a7b27b02636a68814f1cdd623d883d632e2e7b32f484044142753e860e6ab85d0e0ba1db2d49
6
+ metadata.gz: 58ae304620ccfac55ec0d88a4c06f3c48b25770103439d73b95746399a8acabd73292a262fed529b0eeb5a791ba1bfdf7de0889b5d23aaf42b07c2bf1c4ea960
7
+ data.tar.gz: 19f07d138c5cdb0b85486fec3891a80eb0b6c0ca5ca1f70a0c14870b2960cf4329530cefc344eb1ffdfca19b5500064367339beb373c377e145f1b7155d944f2
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "2.0.13".freeze
3
+ VERSION = "2.0.14".freeze
4
4
  end
5
5
  end
data/lib/utils/xml.rb CHANGED
@@ -52,7 +52,12 @@ module Metanorma
52
52
  # large compiles. Fragments off the shared document are
53
53
  # independent trees; conversion is single-threaded.
54
54
  def noko(_script = "Latn", &block)
55
- fragment = noko_template.fragment("")
55
+ # DocumentFragment.new without input skips the per-call parse:
56
+ # fragment("") minted a ParseOptions and ran a parse pass on
57
+ # the empty string for every call (73k per plateau compile,
58
+ # 30% of this method's wall time, measured). The built
59
+ # serialization is byte-identical.
60
+ fragment = Nokogiri::XML::DocumentFragment.new(noko_template)
56
61
  ::Nokogiri::XML::Builder.with fragment, &block
57
62
  fragment
58
63
  .to_xml(encoding: "UTF-8", indent: 0,
@@ -88,8 +93,9 @@ module Metanorma
88
93
  def noko_html(&block)
89
94
  # Fragments off the shared template are independent trees, like in
90
95
  # #noko: duplicating the whole scaffold document per call buys
91
- # nothing and copies every node of it.
92
- fragment = noko_template.fragment("")
96
+ # nothing and copies every node of it. No-input new skips the
97
+ # per-call parse, as in #noko.
98
+ fragment = Nokogiri::XML::DocumentFragment.new(noko_template)
93
99
  ::Nokogiri::XML::Builder.with fragment, &block
94
100
  fragment.to_xml(encoding: "UTF-8", indent: 0,
95
101
  save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.