moxml 0.5.11 → 0.5.12

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: 15a0dd834bc1c9637a8d2284173d4994b1717b1bd2d8d9461686a56c679942e6
4
- data.tar.gz: 4635e66b998d8fa371dd1617d0f960fc31b8a886627095061f945aa8b29cae41
3
+ metadata.gz: 7f702d6c51c5df49bdb2bf0ac5189d3fe0716d94093ced7decdb743dcf87fa5d
4
+ data.tar.gz: 56316b016c8865d6290033873477d9dcc92b04e1e16ae77716626398bd976ad3
5
5
  SHA512:
6
- metadata.gz: 6eace14b6adb980bc4c14c6f628b231961f47fab55e05a0bf809591b4203a6581f0cb333dc358ec3bebeb1c239f7ecd65fc68ca34ee70fb1bf71fbf8c00f278c
7
- data.tar.gz: f03e39569fd299ac6a7e8dc266d97a5499fea6f89b166f64e46944649286df8a6ceb4fd4732b6a67cac160f2318b0ed4c79fc8d782184b3a090b9c3feb65be1e
6
+ metadata.gz: a1e503460e2b5d645cd4147d4164d2a67c254e8e2174b145fbf4f17dab222d1eae03216b7a35dca18a800684c3c904daf9633140f262195f212d9dd235ccc675
7
+ data.tar.gz: 4cf7957e370339230fc4d184a7fd6b9312bd3f5e8f9e843984ed4e56967e33597d18abef6479de69cde47af781a65703427349cdaff16eaf317cdb39ba8cd135
@@ -27,6 +27,12 @@ module Moxml
27
27
  # DTD ATTLIST defaults, matching libxml2/Nokogiri semantics;
28
28
  # ParseOptions::DTDATTR opts in (leptris/leptris#606).
29
29
  DTDATTR_SUPPORTED = ::Leptris::XML::ParseOptions.const_defined?(:DTDATTR)
30
+ # leptris-ruby 1.9.32 (#89): traverse is subtree-bounded again —
31
+ # earlier 1.9.x walks followed the document chain and swept
32
+ # following siblings, so element materialize had to fall back
33
+ # to the generic wrapper walk.
34
+ TRAVERSE_SUBTREE_BOUNDED =
35
+ Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.32")
30
36
 
31
37
  class << self
32
38
  def attachments
@@ -282,13 +288,17 @@ module Moxml
282
288
  # ER expansion); the bulk path has no marker handling.
283
289
  return nil if doc.nil? || attachments.get(doc, :entity_markers)
284
290
 
285
- # leptris 1.9.28+'s traverse follows the document chain; from
286
- # an arbitrary element it can visit following siblings. Use
287
- # the bulk path only for document materialization, and filter
288
- # the stream to the document element's subtree (issue #140).
289
- return nil unless native.is_a?(::Leptris::XML::Document)
290
-
291
- root = doc.root
291
+ # On bindings whose traverse follows the document chain
292
+ # (leptris 1.9.28–1.9.31), element materialize falls back to
293
+ # the generic wrapper walk — only document materialization
294
+ # can filter safely there (issue #140).
295
+ root = if native.is_a?(::Leptris::XML::Document)
296
+ doc.root
297
+ else
298
+ return nil unless TRAVERSE_SUBTREE_BOUNDED
299
+
300
+ native
301
+ end
292
302
  return nil if root.nil?
293
303
 
294
304
  depth_memo = {}.compare_by_identity
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.11"
4
+ VERSION = "0.5.12"
5
5
  end
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.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.