moxml 0.5.52 → 0.5.54

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: 5b9e4f8b355a983117cbc435343e414c731791232b8ecee131f5de68fe8e7ce8
4
- data.tar.gz: 9409d7e0b355d76423acb9abbc812a09665110c53ba29e04cf838d486d257c4e
3
+ metadata.gz: ba51d35ca414232eb04fafd976a2f5d24b2f43fff1b0e4c4a69147162da324c7
4
+ data.tar.gz: 73df7c7f9da2ff33e4ab2d06f3b56b29b0a09e4784c78eb9907d3ec15f82c234
5
5
  SHA512:
6
- metadata.gz: '028a06c0b8f3e041f4ac257df4104052137f4d64d590d1be2c58f093dbf6909685767924c08914e1624daeb7bb8d419e2ad034ae61003a5099e7c673c7ced58b'
7
- data.tar.gz: 0f737e2a0055194c05492bfebee65253e5a45fffecdd610e0c1f46b53728e23483acc44cdd48165313c213b8fca597685e1bf8e0f28db6afa8a67c28ae1c4167
6
+ metadata.gz: c30f3bef444d6a6da7416e5ee5493c5656a6bbca1f28c9d504c9405b3be54b083eb5bf9a218ed1e0ac1cb94b3551678c028adadf667fcc7b15b50a2e403341ab
7
+ data.tar.gz: cef805979f7168ec08ce5dc80624e74a2bef27225233d1389862d84b6d4d9cea56806b50a6231e078a626ba488ce90668e0fd8b40ad6cf11a650a3b154c24041
data/README.adoc CHANGED
@@ -51,8 +51,55 @@ Leptris:: https://github.com/leptris/leptris[Leptris], a pure-C99 XML 1.0
51
51
  parser with a W3C-conformant XPath 1.0 engine, consumed through the
52
52
  https://github.com/leptris/leptris-ruby[leptris-ruby] FFI binding
53
53
  (precompiled platform gems — no compilation at install). Fastest on
54
- every measured operation; requires leptris >= 1.2 for programmatic
55
- document construction.
54
+ every measured operation; requires leptris >= 1.9.32 (see version table below).
55
+
56
+ === Underlying library versions
57
+
58
+ Moxml declares no runtime gem dependencies: you bundle the adapter
59
+ gem(s) you want. Each adapter carries the version floor it is built
60
+ and tested against — older versions are untested and the leptris
61
+ adapter refuses to load below its floor.
62
+
63
+ [cols="2,3,5"]
64
+ |===
65
+ |Adapter |Acceptable versions |Notes
66
+
67
+ |REXML
68
+ |Ruby-bundled (Ruby >= 3.0)
69
+ |Always available; no gem to manage.
70
+
71
+ |Nokogiri
72
+ |>= 1.18
73
+ |Tested against the 1.18 line.
74
+
75
+ |Ox
76
+ |>= 2.14
77
+ |Tested against the 2.14 line.
78
+
79
+ |Oga
80
+ |3.4 / 3.5
81
+ |The moxml repository vendors an Opal-compatible fork of oga 3.4
82
+ for development and CI. Oga 4.x is not yet validated against
83
+ moxml's customized generator and decoder overrides.
84
+
85
+ |LibXML (libxml-ruby)
86
+ |>= 5.0
87
+ |6.x works and is the installed default on Ruby >= 3.2 (libxml-ruby
88
+ 6.0 itself requires Ruby >= 3.2); Ruby 3.1 resolves 5.x.
89
+
90
+ |Leptris (leptris-ruby)
91
+ |>= 1.9.32
92
+ |Hard floor — `MINIMUM_BINDING_VERSION`; older bindings do not load.
93
+ Newer bindings unlock more native surface automatically:
94
+ 1.9.163.7+ single-result XPath seams, 1.9.174.4+ C-minted identity
95
+ wrappers, 1.9.174.6+ one-dispatch subtree walks, 1.9.177+ first-class
96
+ entity references (`entity_mode: :keep`). The release notes carry the
97
+ current recommendation.
98
+ |===
99
+
100
+ NOTE: moxml's dev Gemfile pins `leptris ~> 1.9.174`, `nokogiri ~> 1.18`,
101
+ `ox ~> 2.14`, `libxml-ruby >= 5.0`, and the vendored oga fork — the CI
102
+ matrix tests exactly those floors.
56
103
 
57
104
  ==== Default adapter selection
58
105
 
@@ -61,7 +108,7 @@ the runtime environment:
61
108
 
62
109
  . If running on Opal (`RUBY_ENGINE == "opal"`), Oga is used (pure Ruby, no C extensions)
63
110
  . Otherwise, if the installed leptris gem supports programmatic document
64
- construction (`Leptris::XML::Document.create`, leptris >= 1.2), Leptris is used
111
+ construction (`Leptris::XML::Document.create`, leptris >= 1.9.32), Leptris is used
65
112
  . Otherwise, Moxml detects already-loaded XML libraries in this order:
66
113
  .. Nokogiri
67
114
  .. Ox
@@ -72,7 +119,7 @@ the runtime environment:
72
119
  ----
73
120
  # Automatic detection — picks the best available adapter
74
121
  ctx = Moxml.new
75
- ctx.config.adapter_name # => :leptris (leptris >= 1.2), :nokogiri otherwise, :oga on Opal
122
+ ctx.config.adapter_name # => :leptris (leptris >= 1.9.32), :nokogiri otherwise, :oga on Opal
76
123
 
77
124
  # Explicit override — always takes precedence
78
125
  ctx = Moxml.new(:ox)
@@ -973,7 +973,12 @@ module Moxml
973
973
  end
974
974
 
975
975
  def children(node, entity_bearing: false)
976
- if NATIVE_ENTITY_REFS &&
976
+ # NATIVE_READ_LAYER gates the whole keep-path: it consults
977
+ # NN_DOCUMENT (defined only with the native layer), and
978
+ # native-less installs answer through the binding case
979
+ # branch below, whose children already carry first-class
980
+ # EntityReference nodes (issue #240).
981
+ if NATIVE_READ_LAYER && NATIVE_ENTITY_REFS &&
977
982
  native_keep_entity_refs?(node)
978
983
  return to_binding(node).children.to_a
979
984
  end
@@ -1041,7 +1046,8 @@ module Moxml
1041
1046
  end
1042
1047
 
1043
1048
  def native_keep_entity_refs?(node)
1044
- return false unless node.is_a?(::Leptris::XML::NativeNode)
1049
+ return false unless NATIVE_READ_LAYER &&
1050
+ node.is_a?(::Leptris::XML::NativeNode)
1045
1051
 
1046
1052
  doc = NN_DOCUMENT.bind_call(node)
1047
1053
  attachments.get(doc, :keep_entity_refs) == true
@@ -561,9 +561,10 @@ module Moxml
561
561
  )
562
562
  end
563
563
 
564
- # Whether this oga build honors the indent option (newer
565
- # releases do; the capability probe keeps the indentation
566
- # spec pending-or-live across both).
564
+ # Whether this adapter's oga serialization honors the
565
+ # indent option (the customized generator currently does
566
+ # not; the probe keeps the indentation spec pending-or-live
567
+ # per environment).
567
568
  def indents_output?
568
569
  return @indents_output unless @indents_output.nil?
569
570
 
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.52"
4
+ VERSION = "0.5.54"
5
5
  end
@@ -1,9 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  begin
4
- require "libxml-ruby" rescue (require "libxml")
4
+ require "libxml-ruby"
5
5
  rescue LoadError
6
- return
6
+ begin
7
+ require "libxml"
8
+ rescue LoadError
9
+ # LibXML gem not available - skip all specs in this file
10
+ return
11
+ end
7
12
  end
8
13
 
9
14
  require "moxml/adapter/libxml"
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.52
4
+ version: 0.5.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.