moxml 0.1.18 → 0.1.20

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +181 -11
  3. data/README.adoc +24 -1
  4. data/docs/_guides/node-api-consistency.adoc +4 -0
  5. data/lib/moxml/adapter/base.rb +6 -1
  6. data/lib/moxml/adapter/customized_ox/text.rb +15 -2
  7. data/lib/moxml/adapter/customized_rexml/formatter.rb +1 -0
  8. data/lib/moxml/adapter/libxml.rb +7 -2
  9. data/lib/moxml/adapter/oga.rb +6 -2
  10. data/lib/moxml/adapter/ox.rb +15 -8
  11. data/lib/moxml/builder.rb +12 -5
  12. data/lib/moxml/config.rb +1 -1
  13. data/lib/moxml/entity_registry.rb +1 -0
  14. data/lib/moxml/native_attachment/native.rb +69 -0
  15. data/lib/moxml/native_attachment/opal.rb +34 -0
  16. data/lib/moxml/native_attachment.rb +16 -46
  17. data/lib/moxml/text.rb +4 -0
  18. data/lib/moxml/version.rb +1 -1
  19. data/lib/moxml/xpath/compiler.rb +2 -1
  20. data/spec/integration/shared_examples/edge_cases.rb +4 -2
  21. data/spec/integration/shared_examples/entity_reference_whitespace.rb +1 -1
  22. data/spec/integration/shared_examples/high_level/document_builder_behavior.rb +3 -1
  23. data/spec/integration/shared_examples/node_wrappers/entity_reference_behavior.rb +10 -4
  24. data/spec/integration/shared_examples/node_wrappers/node_set_behavior.rb +1 -1
  25. data/spec/moxml/adapter/headed_ox_spec.rb +1 -1
  26. data/spec/moxml/lazy_parse_spec.rb +1 -1
  27. data/spec/moxml/moxml_spec.rb +6 -40
  28. data/spec/moxml/native_attachment/native_spec.rb +57 -0
  29. data/spec/moxml/native_attachment/opal_spec.rb +29 -0
  30. data/spec/moxml/native_attachment/shared_examples.rb +43 -0
  31. data/spec/moxml/native_attachment_spec.rb +184 -0
  32. data/spec/moxml/text_spec.rb +23 -0
  33. data/spec/moxml/xpath/functions/node_functions_spec.rb +3 -2
  34. data/spec/performance/benchmark_spec.rb +1 -1
  35. metadata +8 -2
@@ -127,7 +127,7 @@ RSpec.describe "XPath Node Functions" do
127
127
  it "inherits language from parent element" do
128
128
  ast = Moxml::XPath::Parser.parse('lang("en")')
129
129
  proc = Moxml::XPath::Compiler.compile_with_cache(ast)
130
- child = doc_with_lang.root.children.first
130
+ child = doc_with_lang.root.children.grep(Moxml::Element).first
131
131
  result = proc.call(child)
132
132
 
133
133
  expect(result).to be true
@@ -136,7 +136,8 @@ RSpec.describe "XPath Node Functions" do
136
136
  it "uses closest xml:lang attribute" do
137
137
  ast = Moxml::XPath::Parser.parse('lang("fr")')
138
138
  proc = Moxml::XPath::Compiler.compile_with_cache(ast)
139
- other = doc_with_lang.root.children[1]
139
+ elements = doc_with_lang.root.children.grep(Moxml::Element)
140
+ other = elements[1]
140
141
  result = proc.call(other)
141
142
 
142
143
  expect(result).to be true
@@ -30,7 +30,7 @@ RSpec.shared_examples "Performance Examples" do
30
30
  rexml: { parser: 0, serializer: 5 },
31
31
  ox: { parser: 2, serializer: 1000 },
32
32
  headed_ox: { parser: 2, serializer: 1000 },
33
- libxml: { parser: 10, serializer: 30 },
33
+ libxml: { parser: 2, serializer: 3 },
34
34
  }
35
35
  end
36
36
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-04-27 00:00:00.000000000 Z
11
+ date: 2026-05-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Moxml is a unified XML manipulation library that provides a common API
@@ -141,6 +141,8 @@ files:
141
141
  - lib/moxml/error.rb
142
142
  - lib/moxml/namespace.rb
143
143
  - lib/moxml/native_attachment.rb
144
+ - lib/moxml/native_attachment/native.rb
145
+ - lib/moxml/native_attachment/opal.rb
144
146
  - lib/moxml/node.rb
145
147
  - lib/moxml/node_set.rb
146
148
  - lib/moxml/processing_instruction.rb
@@ -325,6 +327,10 @@ files:
325
327
  - spec/moxml/moxml_spec.rb
326
328
  - spec/moxml/namespace_spec.rb
327
329
  - spec/moxml/namespace_uri_validation_spec.rb
330
+ - spec/moxml/native_attachment/native_spec.rb
331
+ - spec/moxml/native_attachment/opal_spec.rb
332
+ - spec/moxml/native_attachment/shared_examples.rb
333
+ - spec/moxml/native_attachment_spec.rb
328
334
  - spec/moxml/node_cache_spec.rb
329
335
  - spec/moxml/node_set_cache_spec.rb
330
336
  - spec/moxml/node_set_spec.rb