lutaml-model 0.8.109 → 0.8.110
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a49c2cdf5702fe7400d2cc4439632340cf8abe4ed214219d9d53a3bbacff6943
|
|
4
|
+
data.tar.gz: 887431c911fa16aff6372c9c7c7addb034d0722f1ba11b0dfd28fb71bb4fb982
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9c79f442e8be909743b4ecd1eaca9537d61be0d5925336507aa1869907c6795d68aac1a66b67c3fb2cedc0dab86bcab798b7850c3c41d7393a1f9301b862104
|
|
7
|
+
data.tar.gz: d03289efc62a1b6c3cd9c66b6114879a3e68dc05883f20aab395264c2db7c7f0487da4baf2cce95d40493485f238e914b9acb88d974b7638e54efca43f678a30
|
|
@@ -37,11 +37,11 @@ module Lutaml
|
|
|
37
37
|
@conversion_cache = nil
|
|
38
38
|
@configured = false
|
|
39
39
|
@xml_plan_fast_path = true
|
|
40
|
-
# Opt-in until leptris#1743 lands: the native ordered lane
|
|
41
|
-
# runs away (28+ CPU-min / 14GB RSS on sts-ruby's
|
|
42
|
-
# ISO_13849-1 document) — flipping this on by default regressed
|
|
43
|
-
# the sts bench cell from 4m41s to a 10-minute kill.
|
|
44
|
-
@xml_plan_ordered_path = false
|
|
40
|
+
# Opt-in until leptris#1743 lands: the native ordered lane
|
|
41
|
+
# runs away (28+ CPU-min / 14GB RSS on sts-ruby's
|
|
42
|
+
# ISO_13849-1 document) — flipping this on by default regressed
|
|
43
|
+
# the sts bench cell from 4m41s to a 10-minute kill.
|
|
44
|
+
@xml_plan_ordered_path = false
|
|
45
45
|
@element_order_tracking = true
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -139,7 +139,13 @@ module Lutaml
|
|
|
139
139
|
plan = Lutaml::Xml::Leptris::PlanCompiler.compile(self, register)
|
|
140
140
|
return nil unless plan
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
# strict: the from_xml contract raises on malformed input —
|
|
143
|
+
# the FFI lane parses leniently by default and would answer a
|
|
144
|
+
# best-effort tree where every other adapter raises. The
|
|
145
|
+
# kwarg spellings vary by engine vintage (strict: landed
|
|
146
|
+
# after 1.9.353, recover: on 1.9.344+), so probe the resolved
|
|
147
|
+
# parse method and pass the strictest spelling it accepts.
|
|
148
|
+
root = ::Leptris::XML.parse(data.to_s, **leptris_strict_kwargs).root
|
|
143
149
|
return nil if root.nil?
|
|
144
150
|
return nil unless root.name == plan[:tree][:name]
|
|
145
151
|
|
|
@@ -154,6 +160,15 @@ module Lutaml
|
|
|
154
160
|
raise Lutaml::Model::InvalidFormatError.new(:xml, e.message)
|
|
155
161
|
end
|
|
156
162
|
|
|
163
|
+
def leptris_strict_kwargs
|
|
164
|
+
params = ::Leptris::XML.method(:parse).parameters
|
|
165
|
+
.map { |_, key| key }
|
|
166
|
+
kwargs = {}
|
|
167
|
+
kwargs[:recover] = false if params.include?(:recover)
|
|
168
|
+
kwargs[:strict] = true if params.include?(:strict)
|
|
169
|
+
kwargs
|
|
170
|
+
end
|
|
171
|
+
|
|
157
172
|
# Get list of error types that can be raised during format parsing.
|
|
158
173
|
# Core errors are always included; format-specific errors come from
|
|
159
174
|
# FormatRegistry registrations.
|
data/lib/lutaml/model/version.rb
CHANGED
|
@@ -49,13 +49,13 @@ RSpec.describe Lutaml::Model::AdapterResolver, ".adapter_for with a configured t
|
|
|
49
49
|
_stdout, stderr, status = Open3.capture3(RbConfig.ruby, "-I", "lib", "-e", probe)
|
|
50
50
|
expect(status).to be_success, stderr
|
|
51
51
|
end
|
|
52
|
-
end
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
describe "plan lane defaults" do
|
|
54
|
+
it "ships the ordered plan lane opt-in until leptris#1743 is fixed" do
|
|
55
|
+
# The native ordered lane runs away on sts-ruby's ISO_13849-1
|
|
56
|
+
# document (leptris#1743): 28+ CPU-min / 14 GB RSS vs 6.36s on the
|
|
57
|
+
# same parse with the lane off. Opt-in until the engine fix ships.
|
|
58
|
+
expect(Lutaml::Model::Config.instance.xml_plan_ordered_path).to be(false)
|
|
59
|
+
end
|
|
60
60
|
end
|
|
61
61
|
end
|