moxml 0.5.174 → 0.5.175
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/moxml/adapter/leptris.rb +10 -1
- data/lib/moxml/version.rb +1 -1
- data/spec/moxml/adapter_capabilities_spec.rb +18 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 14463613d8081db0efee985379ddcae7740f8044d9f0f7a8192f5f1828337a27
|
|
4
|
+
data.tar.gz: 7fcb65b5d65fedc5d9766d31f409441eafba5f78b8212478a854bcd17ffdf167
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7c402c813be0883260893a9e47290653e61104cf870702d7d46b155299d87752f8ec5662455ebb0b75c4b776d8962502d7ed223a3b5fca0764fb2600ae67488
|
|
7
|
+
data.tar.gz: cc0a50d550e12d1496c0f31a623c9e1c3a7569fe1d65b7796b97a1a30d63d994812d02c28cd6cfcfd22352a11d0fc9ed25d4a2488bda768ac0898342dad7837a
|
|
@@ -335,9 +335,18 @@ module Moxml
|
|
|
335
335
|
# consumers ask for them by name; the internal routing gates
|
|
336
336
|
# the floor made constant are absent by design. Frozen; the
|
|
337
337
|
# keys are the model's capability names.
|
|
338
|
+
#
|
|
339
|
+
# Two versions, never conflated (the binding vendors the
|
|
340
|
+
# engine; the numbers differ): +binding_version+ is the gem's
|
|
341
|
+
# (Leptris::VERSION), +engine_version+ is libleptris's own
|
|
342
|
+
# (the leptris_version() C face, face-probed — nil on a
|
|
343
|
+
# binding without it).
|
|
338
344
|
def capabilities
|
|
339
345
|
@capabilities ||= {
|
|
340
|
-
|
|
346
|
+
binding_version: ::Leptris::VERSION,
|
|
347
|
+
engine_version:
|
|
348
|
+
(::Leptris::XML::FFI.leptris_version if
|
|
349
|
+
::Leptris::XML::FFI.respond_to?(:leptris_version)),
|
|
341
350
|
native_read_layer: !NATIVE_READ_LAYER.nil?,
|
|
342
351
|
native_xpath_seams: !NATIVE_XPATH_SEAMS.nil?,
|
|
343
352
|
bulk_xpath_rows: BULK_XPATH_ROWS,
|
data/lib/moxml/version.rb
CHANGED
|
@@ -8,11 +8,13 @@ require "spec_helper"
|
|
|
8
8
|
# what the installed binding+engine serves — queried once at attach,
|
|
9
9
|
# the replacement for the version-gate-constant class. Only
|
|
10
10
|
# runtime-variable faces appear; anything the floor makes
|
|
11
|
-
# unconditional is absent by design.
|
|
11
|
+
# unconditional is absent by design. The two versions are never
|
|
12
|
+
# conflated: the binding vendors the engine, and the numbers differ.
|
|
12
13
|
RSpec.describe "engine capability report" do
|
|
13
|
-
it "answers for leptris with
|
|
14
|
+
it "answers for leptris with both versions and known faces" do
|
|
14
15
|
caps = Moxml::Adapter::Leptris.capabilities
|
|
15
16
|
expect(caps).to be_frozen
|
|
17
|
+
expect(caps[:binding_version]).to eq(Leptris::VERSION)
|
|
16
18
|
expect(caps[:engine_version]).to match(/\A1\.\d+\.\d+/)
|
|
17
19
|
expect(caps.keys).to include(
|
|
18
20
|
:native_read_layer, :native_plan_structs, :native_plan_typed,
|
|
@@ -20,9 +22,21 @@ RSpec.describe "engine capability report" do
|
|
|
20
22
|
)
|
|
21
23
|
end
|
|
22
24
|
|
|
23
|
-
it "
|
|
25
|
+
it "answers the ENGINE's version under engine_version, not the binding's" do
|
|
24
26
|
caps = Moxml::Adapter::Leptris.capabilities
|
|
25
|
-
|
|
27
|
+
engine = Leptris::XML::FFI.leptris_version
|
|
28
|
+
expect(caps[:engine_version]).to eq(engine)
|
|
29
|
+
if Gem::Version.new(Leptris::VERSION) != Gem::Version.new(engine)
|
|
30
|
+
expect(caps[:binding_version]).not_to eq(caps[:engine_version]),
|
|
31
|
+
"binding and engine versions are " \
|
|
32
|
+
"different numbers; the report must " \
|
|
33
|
+
"never conflate them"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it "reports only booleans beyond the versions" do
|
|
38
|
+
caps = Moxml::Adapter::Leptris.capabilities
|
|
39
|
+
caps.except(:binding_version, :engine_version).each_value do |value|
|
|
26
40
|
expect(value).to eql(true).or eql(false)
|
|
27
41
|
end
|
|
28
42
|
end
|