moxml 0.5.172 → 0.5.173
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/docs/_pages/model-coverage.adoc +1 -0
- data/docs/_references/processing-model.adoc +7 -1
- data/lib/moxml/adapter/base.rb +9 -0
- data/lib/moxml/adapter/leptris.rb +31 -0
- data/lib/moxml/version.rb +1 -1
- data/spec/moxml/adapter_capabilities_spec.rb +48 -0
- data/spec/support/model_coverage.rb +4 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be4403ff94123c6d65bf53402d99fee7462bd4d3e9c3ae34f87ff43170fddc29
|
|
4
|
+
data.tar.gz: 642a836819599fc943103d87d0148cf34e40544d94cf376b4d2d74e5d65bc25e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ac3bb7ae1148c02ed3c9812c448c8a20e521854f201c20ef22a22dbbc4cd9c12f01d0d1ea4d19f29d4f35f6781d83ace0d4db88957877a8758a621c4b720ecb
|
|
7
|
+
data.tar.gz: 2513f3da33f3b1836276b51428e9db7e814416db761bcaa3813bf0fd326851359e5a3cc6bb2e62401f0bbbf0aaa44b44dc7992dbb58a4bc475849cc659dd720d
|
|
@@ -48,6 +48,7 @@ Generated by `bundle exec rake docs:coverage` from the coverage matrix and the d
|
|
|
48
48
|
| validation schema sets | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
49
49
|
| validation substitution dismissal | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
50
50
|
| loud capability contracts | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
51
|
+
| engine capability report | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
51
52
|
|===
|
|
52
53
|
|
|
53
54
|
*equivalent* — all adapters answer the same observable result. *loud (...)* — the adapter raises the named error for that face. *D-NN* — a registered divergence in link:divergences.html[the register], with its rationale. Every cell cites a pin; see the processing model's `Pins::` line for the enforcing specs.
|
|
@@ -314,7 +314,7 @@ answers without raising. RELAX NG rides engines with an RNG face
|
|
|
314
314
|
|
|
315
315
|
=== Errors and loud degradation
|
|
316
316
|
|
|
317
|
-
Pins:: `spec/consistency/loud_degradation_spec.rb`
|
|
317
|
+
Pins:: `spec/consistency/loud_degradation_spec.rb`, `spec/moxml/adapter_capabilities_spec.rb`
|
|
318
318
|
|
|
319
319
|
* `Moxml::Error` hierarchy; `Moxml::XPathError`, `Moxml::XsltError`,
|
|
320
320
|
`Moxml::AdapterError` (e.g. schema-handle/adapter misroute),
|
|
@@ -324,6 +324,12 @@ Pins:: `spec/consistency/loud_degradation_spec.rb`
|
|
|
324
324
|
* Adapter degradation is loud: a present-but-unusable preferred adapter
|
|
325
325
|
warns at configuration and misroutes fail at the wrap, not deep in
|
|
326
326
|
a call.
|
|
327
|
+
* Engines with a capability story answer `Adapter.capabilities` — one
|
|
328
|
+
frozen report of the runtime-variable faces they serve plus their
|
|
329
|
+
engine version, queried once at attach. The support faces (xsd,
|
|
330
|
+
relaxng, xslt, digest) answer even when unconditional; internal
|
|
331
|
+
routing gates the floor made constant are absent by design.
|
|
332
|
+
Adapters without a capability story answer nil.
|
|
327
333
|
|
|
328
334
|
=== Performance: a declared, non-semantic channel
|
|
329
335
|
|
data/lib/moxml/adapter/base.rb
CHANGED
|
@@ -698,6 +698,15 @@ namespace_validation_mode: :strict)
|
|
|
698
698
|
nil
|
|
699
699
|
end
|
|
700
700
|
|
|
701
|
+
# The engine capability report (#493): a frozen hash of the
|
|
702
|
+
# runtime-variable faces this adapter serves, plus its engine
|
|
703
|
+
# version — queried once at attach, never version-gate
|
|
704
|
+
# constants. Adapters without a capability story answer nil
|
|
705
|
+
# (documented last resort, plan_rows-style).
|
|
706
|
+
def capabilities
|
|
707
|
+
nil
|
|
708
|
+
end
|
|
709
|
+
|
|
701
710
|
# Struct-plan executor (Moxml::StructPlan): +spec+ compiles
|
|
702
711
|
# the consumer's shape as {name => [Struct class, attrs
|
|
703
712
|
# Hash (name => slot Symbol), text slot, children slot]}.
|
|
@@ -320,6 +320,37 @@ module Moxml
|
|
|
320
320
|
BINDING_OF_CAP = 8_192
|
|
321
321
|
|
|
322
322
|
class << self
|
|
323
|
+
# The engine capability report (#493): one structured face
|
|
324
|
+
# answering what THIS installed binding+engine serves, queried
|
|
325
|
+
# once at attach — the replacement for the version-gate-
|
|
326
|
+
# constant class. The support faces (xsd, relaxng, xslt,
|
|
327
|
+
# digest) answer even when the floor makes them unconditional —
|
|
328
|
+
# consumers ask for them by name; the internal routing gates
|
|
329
|
+
# the floor made constant are absent by design. Frozen; the
|
|
330
|
+
# keys are the model's capability names.
|
|
331
|
+
def capabilities
|
|
332
|
+
@capabilities ||= {
|
|
333
|
+
engine_version: ::Leptris::VERSION,
|
|
334
|
+
native_read_layer: !NATIVE_READ_LAYER.nil?,
|
|
335
|
+
native_xpath_seams: !NATIVE_XPATH_SEAMS.nil?,
|
|
336
|
+
bulk_xpath_rows: BULK_XPATH_ROWS,
|
|
337
|
+
add_element_full: ADD_ELEMENT_FULL,
|
|
338
|
+
native_strings_utf8: !NATIVE_STRINGS_UTF8.nil?,
|
|
339
|
+
native_mutations_coherent: !NATIVE_MUTATIONS_COHERENT.nil?,
|
|
340
|
+
native_entity_refs: !NATIVE_ENTITY_REFS.nil?,
|
|
341
|
+
native_bulk_fixed: !NATIVE_BULK_FIXED.nil?,
|
|
342
|
+
native_bulk_sax_records: NATIVE_SAX_RECORDS,
|
|
343
|
+
native_document_parts: NATIVE_DOC_PARTS,
|
|
344
|
+
native_plan_rows: NATIVE_PLAN_ROWS,
|
|
345
|
+
native_plan_structs: NATIVE_PLAN_STRUCTS,
|
|
346
|
+
native_plan_typed: NATIVE_PLAN_TYPED,
|
|
347
|
+
digest: DIGEST_SUPPORTED,
|
|
348
|
+
xsd: XSD_SUPPORTED,
|
|
349
|
+
relaxng: RELAXNG_SUPPORTED,
|
|
350
|
+
xslt: XSLT_SUPPORTED,
|
|
351
|
+
}.freeze
|
|
352
|
+
end
|
|
353
|
+
|
|
323
354
|
# WeakMap has no #clear — 0.5.100's valve crashed every parse
|
|
324
355
|
# crossing the cap on 3.4+ (NoMethodError). Replace the
|
|
325
356
|
# registry wholesale, type-preserving: the WeakMap flavor
|
data/lib/moxml/version.rb
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Processing model §Errors and loud degradation (normative): pinned here.
|
|
4
|
+
|
|
5
|
+
require "spec_helper"
|
|
6
|
+
|
|
7
|
+
# The engine capability report (#493): one structured face answering
|
|
8
|
+
# what the installed binding+engine serves — queried once at attach,
|
|
9
|
+
# the replacement for the version-gate-constant class. Only
|
|
10
|
+
# runtime-variable faces appear; anything the floor makes
|
|
11
|
+
# unconditional is absent by design.
|
|
12
|
+
RSpec.describe "engine capability report" do
|
|
13
|
+
it "answers for leptris with the engine version and known faces" do
|
|
14
|
+
caps = Moxml::Adapter::Leptris.capabilities
|
|
15
|
+
expect(caps).to be_frozen
|
|
16
|
+
expect(caps[:engine_version]).to match(/\A1\.\d+\.\d+/)
|
|
17
|
+
expect(caps.keys).to include(
|
|
18
|
+
:native_read_layer, :native_plan_structs, :native_bulk_sax_records,
|
|
19
|
+
:native_document_parts, :xsd, :relaxng, :xslt, :digest
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "reports only booleans beyond the version" do
|
|
24
|
+
caps = Moxml::Adapter::Leptris.capabilities
|
|
25
|
+
caps.except(:engine_version).each_value do |value|
|
|
26
|
+
expect(value).to eql(true).or eql(false)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "keeps the unwound internal gates out of the report" do
|
|
31
|
+
caps = Moxml::Adapter::Leptris.capabilities
|
|
32
|
+
expect(caps.keys).not_to include(
|
|
33
|
+
:prefixed_attr_predicates_native, :libxml2_layout_parity,
|
|
34
|
+
:indent_unit_supported, :element_unit_comments
|
|
35
|
+
)
|
|
36
|
+
expect(caps[:xsd]).to be(true)
|
|
37
|
+
expect(caps[:xslt]).to be(true)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it "is memoized — repeated queries answer the same frozen object" do
|
|
41
|
+
expect(Moxml::Adapter::Leptris.capabilities)
|
|
42
|
+
.to equal(Moxml::Adapter::Leptris.capabilities)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "answers nil on adapters without a capability story" do
|
|
46
|
+
expect(Moxml::Adapter::Base.capabilities).to be_nil
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -113,6 +113,10 @@ module ModelCoverage
|
|
|
113
113
|
section: "Errors and loud degradation",
|
|
114
114
|
pin: "spec/consistency/loud_degradation_spec.rb",
|
|
115
115
|
},
|
|
116
|
+
"engine capability report" => {
|
|
117
|
+
section: "Errors and loud degradation",
|
|
118
|
+
pin: "spec/moxml/adapter_capabilities_spec.rb",
|
|
119
|
+
},
|
|
116
120
|
}.freeze
|
|
117
121
|
|
|
118
122
|
# Normative sections that are not face families (meta/apparatus).
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moxml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.173
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -514,6 +514,7 @@ files:
|
|
|
514
514
|
- spec/moxml/adapter/rexml_spec.rb
|
|
515
515
|
- spec/moxml/adapter/shared_examples/.gitkeep
|
|
516
516
|
- spec/moxml/adapter/shared_examples/adapter_contract.rb
|
|
517
|
+
- spec/moxml/adapter_capabilities_spec.rb
|
|
517
518
|
- spec/moxml/adapter_deprecation_spec.rb
|
|
518
519
|
- spec/moxml/adapter_registry_spec.rb
|
|
519
520
|
- spec/moxml/adapter_spec.rb
|