moxml 0.1.10 → 0.1.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.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +1 -1
  3. data/.github/workflows/rake.yml +16 -13
  4. data/.github/workflows/release.yml +1 -0
  5. data/.github/workflows/round-trip.yml +74 -0
  6. data/.gitignore +1 -0
  7. data/.rubocop.yml +1 -0
  8. data/.rubocop_todo.yml +160 -38
  9. data/Gemfile +2 -1
  10. data/README.adoc +236 -0
  11. data/Rakefile +11 -0
  12. data/data/w3c_entities.json +2131 -0
  13. data/docs/ENTITY_SUPPORT_FOR_LUTAML_MODEL.md +102 -0
  14. data/docs/_pages/adapters/ox.adoc +30 -0
  15. data/docs/_pages/configuration.adoc +43 -0
  16. data/docs/_pages/node-api-reference.adoc +35 -0
  17. data/docs/_tutorials/namespace-handling.adoc +21 -0
  18. data/examples/rss_parser/rss_parser.rb +1 -3
  19. data/lib/moxml/adapter/base.rb +26 -2
  20. data/lib/moxml/adapter/headed_ox.rb +5 -4
  21. data/lib/moxml/adapter/libxml.rb +3 -2
  22. data/lib/moxml/adapter/nokogiri.rb +16 -3
  23. data/lib/moxml/adapter/oga.rb +124 -20
  24. data/lib/moxml/adapter/ox.rb +4 -3
  25. data/lib/moxml/adapter/rexml.rb +41 -7
  26. data/lib/moxml/builder.rb +6 -0
  27. data/lib/moxml/config.rb +52 -1
  28. data/lib/moxml/context.rb +21 -2
  29. data/lib/moxml/document.rb +6 -1
  30. data/lib/moxml/document_builder.rb +45 -1
  31. data/lib/moxml/element.rb +4 -3
  32. data/lib/moxml/entity_reference.rb +29 -0
  33. data/lib/moxml/entity_registry.rb +278 -0
  34. data/lib/moxml/node.rb +10 -8
  35. data/lib/moxml/node_set.rb +10 -6
  36. data/lib/moxml/version.rb +1 -1
  37. data/lib/moxml/xml_utils.rb +25 -2
  38. data/lib/moxml.rb +1 -0
  39. data/spec/consistency/README.md +3 -1
  40. data/spec/consistency/round_trip_spec.rb +479 -0
  41. data/spec/examples/readme_examples_spec.rb +1 -1
  42. data/spec/fixtures/round-trips/metanorma/a.xml +66 -0
  43. data/spec/fixtures/round-trips/metanorma/bilingual-en.xml +7682 -0
  44. data/spec/fixtures/round-trips/metanorma/bilingual-fr.xml +7520 -0
  45. data/spec/fixtures/round-trips/metanorma/bilingual.presentation.xml +21211 -0
  46. data/spec/fixtures/round-trips/metanorma/collection1.xml +313 -0
  47. data/spec/fixtures/round-trips/metanorma/collection1nested.xml +291 -0
  48. data/spec/fixtures/round-trips/metanorma/collection_docinline.xml +544 -0
  49. data/spec/fixtures/round-trips/metanorma/collection_full.xml +1776 -0
  50. data/spec/fixtures/round-trips/metanorma/dummy.1.xml +295 -0
  51. data/spec/fixtures/round-trips/metanorma/dummy.xml +349 -0
  52. data/spec/fixtures/round-trips/metanorma/footnotes.xml +70 -0
  53. data/spec/fixtures/round-trips/metanorma/iho.xml +116 -0
  54. data/spec/fixtures/round-trips/metanorma/rice-amd.final.xml +186 -0
  55. data/spec/fixtures/round-trips/metanorma/rice-amd.final_1.xml +180 -0
  56. data/spec/fixtures/round-trips/metanorma/rice-en.final.norepo.xml +116 -0
  57. data/spec/fixtures/round-trips/metanorma/rice-en.final.xml +149 -0
  58. data/spec/fixtures/round-trips/metanorma/rice-en.final_1.xml +144 -0
  59. data/spec/fixtures/round-trips/metanorma/rice1-en.final.xml +120 -0
  60. data/spec/fixtures/round-trips/metanorma/rice2-en.final.xml +116 -0
  61. data/spec/fixtures/round-trips/metanorma/test_sectionsplit.xml +119 -0
  62. data/spec/fixtures/round-trips/niso-jats/bmj_sample.xml +1068 -0
  63. data/spec/fixtures/round-trips/niso-jats/element_citation.xml +7 -0
  64. data/spec/fixtures/round-trips/niso-jats/pnas_sample.xml +3768 -0
  65. data/spec/fixtures/round-trips/rfcxml/rfc8881.xml +45848 -0
  66. data/spec/fixtures/round-trips/rfcxml/rfc8994.xml +6607 -0
  67. data/spec/fixtures/round-trips/rfcxml/rfc9000.xml +9064 -0
  68. data/spec/fixtures/round-trips/rfcxml/rfc9043.xml +5527 -0
  69. data/spec/fixtures/round-trips/rfcxml/rfc9051.xml +14286 -0
  70. data/spec/fixtures/round-trips/rfcxml/rfc9110.xml +18156 -0
  71. data/spec/fixtures/round-trips/rfcxml/rfc9260.xml +9136 -0
  72. data/spec/fixtures/round-trips/rfcxml/rfc9293.xml +8300 -0
  73. data/spec/fixtures/round-trips/rfcxml/rfc9380.xml +8916 -0
  74. data/spec/fixtures/round-trips/rfcxml/rfc9420.xml +8927 -0
  75. data/spec/fixtures/w3c/namespaces/1.0/001.xml +7 -0
  76. data/spec/fixtures/w3c/namespaces/1.0/002.xml +8 -0
  77. data/spec/fixtures/w3c/namespaces/1.0/003.xml +7 -0
  78. data/spec/fixtures/w3c/namespaces/1.0/004.xml +7 -0
  79. data/spec/fixtures/w3c/namespaces/1.0/005.xml +7 -0
  80. data/spec/fixtures/w3c/namespaces/1.0/006.xml +7 -0
  81. data/spec/fixtures/w3c/namespaces/1.0/007.xml +20 -0
  82. data/spec/fixtures/w3c/namespaces/1.0/008.xml +20 -0
  83. data/spec/fixtures/w3c/namespaces/1.0/009.xml +19 -0
  84. data/spec/fixtures/w3c/namespaces/1.0/010.xml +19 -0
  85. data/spec/fixtures/w3c/namespaces/1.0/011.xml +20 -0
  86. data/spec/fixtures/w3c/namespaces/1.0/012.xml +19 -0
  87. data/spec/fixtures/w3c/namespaces/1.0/013.xml +5 -0
  88. data/spec/fixtures/w3c/namespaces/1.0/014.xml +3 -0
  89. data/spec/fixtures/w3c/namespaces/1.0/015.xml +3 -0
  90. data/spec/fixtures/w3c/namespaces/1.0/016.xml +3 -0
  91. data/spec/fixtures/w3c/namespaces/1.0/017.xml +3 -0
  92. data/spec/fixtures/w3c/namespaces/1.0/018.xml +3 -0
  93. data/spec/fixtures/w3c/namespaces/1.0/019.xml +3 -0
  94. data/spec/fixtures/w3c/namespaces/1.0/020.xml +3 -0
  95. data/spec/fixtures/w3c/namespaces/1.0/021.xml +6 -0
  96. data/spec/fixtures/w3c/namespaces/1.0/022.xml +6 -0
  97. data/spec/fixtures/w3c/namespaces/1.0/023.xml +6 -0
  98. data/spec/fixtures/w3c/namespaces/1.0/024.xml +6 -0
  99. data/spec/fixtures/w3c/namespaces/1.0/025.xml +3 -0
  100. data/spec/fixtures/w3c/namespaces/1.0/026.xml +3 -0
  101. data/spec/fixtures/w3c/namespaces/1.0/027.xml +3 -0
  102. data/spec/fixtures/w3c/namespaces/1.0/028.xml +3 -0
  103. data/spec/fixtures/w3c/namespaces/1.0/029.xml +4 -0
  104. data/spec/fixtures/w3c/namespaces/1.0/030.xml +4 -0
  105. data/spec/fixtures/w3c/namespaces/1.0/031.xml +4 -0
  106. data/spec/fixtures/w3c/namespaces/1.0/032.xml +5 -0
  107. data/spec/fixtures/w3c/namespaces/1.0/033.xml +4 -0
  108. data/spec/fixtures/w3c/namespaces/1.0/034.xml +3 -0
  109. data/spec/fixtures/w3c/namespaces/1.0/035.xml +8 -0
  110. data/spec/fixtures/w3c/namespaces/1.0/036.xml +8 -0
  111. data/spec/fixtures/w3c/namespaces/1.0/037.xml +8 -0
  112. data/spec/fixtures/w3c/namespaces/1.0/038.xml +8 -0
  113. data/spec/fixtures/w3c/namespaces/1.0/039.xml +10 -0
  114. data/spec/fixtures/w3c/namespaces/1.0/040.xml +9 -0
  115. data/spec/fixtures/w3c/namespaces/1.0/041.xml +8 -0
  116. data/spec/fixtures/w3c/namespaces/1.0/042.xml +4 -0
  117. data/spec/fixtures/w3c/namespaces/1.0/043.xml +7 -0
  118. data/spec/fixtures/w3c/namespaces/1.0/044.xml +7 -0
  119. data/spec/fixtures/w3c/namespaces/1.0/045.xml +7 -0
  120. data/spec/fixtures/w3c/namespaces/1.0/046.xml +10 -0
  121. data/spec/fixtures/w3c/namespaces/1.0/047.xml +4 -0
  122. data/spec/fixtures/w3c/namespaces/1.0/048.xml +5 -0
  123. data/spec/fixtures/w3c/namespaces/1.0/LICENSE.md +32 -0
  124. data/spec/fixtures/w3c/namespaces/1.0/README.adoc +42 -0
  125. data/spec/fixtures/w3c/namespaces/1.0/rmt-ns10.xml +156 -0
  126. data/spec/integration/shared_examples/node_wrappers/element_behavior.rb +14 -0
  127. data/spec/integration/shared_examples/node_wrappers/namespace_behavior.rb +14 -2
  128. data/spec/integration/shared_examples/w3c_namespace_examples.rb +10 -0
  129. data/spec/integration/w3c_namespace_spec.rb +69 -0
  130. data/spec/moxml/adapter/libxml_spec.rb +7 -1
  131. data/spec/moxml/adapter/oga_spec.rb +92 -0
  132. data/spec/moxml/config_spec.rb +75 -0
  133. data/spec/moxml/entity_registry_spec.rb +184 -0
  134. data/spec/moxml/error_spec.rb +2 -2
  135. data/spec/moxml/namespace_uri_validation_spec.rb +140 -0
  136. data/spec/moxml/xpath/axes_spec.rb +3 -4
  137. data/spec/performance/xpath_benchmark_spec.rb +6 -54
  138. data/spec/support/w3c_namespace_helpers.rb +41 -0
  139. data/spec/unit/rexml_isolated_test.rb +271 -0
  140. metadata +98 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07caeff68b2413d8ccaab1e827b151c4b98381f76b0f1feb63cec118be54ae05
4
- data.tar.gz: 76e3eb23022b6d49e5c265467966d29d6ad12617f2a00af3b34680b32f96b8ac
3
+ metadata.gz: 4157530fd51f50d52969541f0a41d18f3b70d2ccada5dea86ea38e3882511385
4
+ data.tar.gz: ea71910278f9883ac2580e3f20d9d6a5ea2d0981fbbd9d9c7fecbcf6b2694247
5
5
  SHA512:
6
- metadata.gz: e0a41270e30bca0664d5e4bf32019d82a262cbfe6c2d001879d8e6259bf06e80a24df2372698ecd651835e88b27be2b7f2552b0d26aaf40aa514de7a870bf5e8
7
- data.tar.gz: 7ade8a4b671b3eb3fe06d2b909783f61bd5172d1645e3c1e9c6344d3e3fb01b5b1c32b8da09b39fedc2b73d04e52edb19956bf00240fbb145798f4be9c598058
6
+ metadata.gz: 47dd22ad3d886d60cd6f4c2717f0d39e78ebbcaa743cb14a072476753410c681fb19b0a6d3fd6019f7a70bb2a7902bbb3239d4255f5fe5041a4fd2dce5beec74
7
+ data.tar.gz: fa217b1a960165a88dc97bcf765147d836dbe77e90be528cdb045ed99c28f6181d59634e50a4059348b89f0a23c4661660e1fb10fe8a46e06e1a434f9e08f456
@@ -26,7 +26,7 @@ jobs:
26
26
  - name: Setup Ruby
27
27
  uses: ruby/setup-ruby@v1
28
28
  with:
29
- ruby-version: '3.3'
29
+ ruby-version: '4.0'
30
30
  bundler-cache: true
31
31
  cache-version: 0
32
32
  working-directory: docs
@@ -1,23 +1,26 @@
1
1
  name: rake
2
2
 
3
- permissions:
4
- contents: write
5
-
6
3
  on:
7
4
  push:
8
5
  branches: [ main ]
9
6
  tags: [ v* ]
10
7
  pull_request:
11
8
 
9
+ permissions:
10
+ contents: read
11
+
12
12
  jobs:
13
13
  rake:
14
- uses: metanorma/ci/.github/workflows/generic-rake.yml@main
15
- with:
16
- before-setup-ruby: |
17
- vcpkg install libxml2:x64-windows 2>&1 || true
18
- vcpkg integrate install 2>&1 || true
19
- mkdir -p .bundle 2>&1 || true
20
- echo "---" > .bundle/config 2>&1 || true
21
- echo 'BUNDLE_BUILD__LIBXML___RUBY: "--with-xml2-dir=C:/vcpkg/installed/x64-windows --with-xml2-include=C:/vcpkg/installed/x64-windows/include/libxml2 --with-xml2-lib=C:/vcpkg/installed/x64-windows/lib"' >> .bundle/config 2>&1 || true
22
- secrets:
23
- pat_token: ${{ secrets.GITHUB_TOKEN }}
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: "3.3"
20
+ bundler-cache: true
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ - name: Run fast tests (unit + adapter + integration)
24
+ run: bundle exec rake spec:fast
25
+ - name: Run rubocop
26
+ run: bundle exec rubocop
@@ -3,6 +3,7 @@ name: release
3
3
  permissions:
4
4
  contents: write
5
5
  packages: write
6
+ id-token: write
6
7
 
7
8
  on:
8
9
  workflow_dispatch:
@@ -0,0 +1,74 @@
1
+ name: round-trip
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ # Fast: Ruby versions with full-support adapters (Nokogiri + Oga).
13
+ # These adapters provide complete XML conformance for production use.
14
+ ruby-versions:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ "3.1", "3.2", "3.3", "3.4", "4.0" ]
20
+ category: [ metanorma, rfcxml, niso-jats ]
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby }}
26
+ bundler-cache: true
27
+ - name: Run round-trip tests (${{ matrix.category }})
28
+ run: bundle exec rspec spec/consistency/ --tag round_trip --tag fixture_category:${{ matrix.category }}
29
+ env:
30
+ MOXML_ROUNDTRIP_TIMEOUT: 120
31
+ MOXML_ROUNDTRIP_ADAPTERS: nokogiri,oga
32
+
33
+ # Experimental: Ox adapter with Nokogiri (Ox lacks full XPath/namespace support).
34
+ nokogiri-ox:
35
+ runs-on: ubuntu-latest
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ ruby: [ "3.3", "4.0" ]
40
+ category: [ metanorma, rfcxml, niso-jats ]
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - uses: ruby/setup-ruby@v1
44
+ with:
45
+ ruby-version: ${{ matrix.ruby }}
46
+ bundler-cache: true
47
+ - name: Run Nokogiri × Ox round-trip tests (${{ matrix.category }})
48
+ run: bundle exec rspec spec/consistency/ --tag round_trip --tag fixture_category:${{ matrix.category }}
49
+ env:
50
+ MOXML_ROUNDTRIP_TIMEOUT: 300
51
+ MOXML_ROUNDTRIP_ADAPTERS: nokogiri,ox
52
+
53
+ # Experimental: REXML adapter with Nokogiri (REXML is pure Ruby, exponentially slow).
54
+ # Skips fixtures over 50KB due to O(n²) complexity.
55
+ nokogiri-rexml:
56
+ runs-on: ubuntu-latest
57
+ continue-on-error: true
58
+ strategy:
59
+ fail-fast: false
60
+ matrix:
61
+ ruby: [ "3.3", "4.0" ]
62
+ category: [ metanorma, rfcxml, niso-jats ]
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ - uses: ruby/setup-ruby@v1
66
+ with:
67
+ ruby-version: ${{ matrix.ruby }}
68
+ bundler-cache: true
69
+ - name: Run Nokogiri × REXML round-trip tests (${{ matrix.category }})
70
+ run: bundle exec rspec spec/consistency/ --tag round_trip --tag fixture_category:${{ matrix.category }}
71
+ env:
72
+ MOXML_ROUNDTRIP_TIMEOUT: 300
73
+ MOXML_ROUNDTRIP_ADAPTERS: nokogiri,rexml
74
+ MOXML_ROUNDTRIP_REXML_MAX_SIZE: 50000
data/.gitignore CHANGED
@@ -43,6 +43,7 @@ libxml_*.txt
43
43
  # Ruby version managers
44
44
  .ruby-version.lock
45
45
  .rvmrc
46
+ .ruby-version
46
47
 
47
48
  # Artifacts from static site generators
48
49
  /_site
data/.rubocop.yml CHANGED
@@ -16,3 +16,4 @@ AllCops:
16
16
  - 'test_*.rb'
17
17
  - 'vendor/**/*'
18
18
  - 'tmp/**/*'
19
+ - 'spec/consistency/round_trip_spec.rb'
data/.rubocop_todo.yml CHANGED
@@ -1,18 +1,97 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-11-26 03:06:16 UTC using RuboCop version 1.80.0.
3
+ # on 2026-04-05 03:01:25 UTC using RuboCop version 1.86.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 203
9
+ # Offense count: 5
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
12
+ # SupportedStyles: with_first_argument, with_fixed_indentation
13
+ Layout/ArgumentAlignment:
14
+ Exclude:
15
+ - 'lib/moxml/config.rb'
16
+ - 'lib/moxml/entity_registry.rb'
17
+ - 'spec/moxml/entity_registry_spec.rb'
18
+
19
+ # Offense count: 1
20
+ # This cop supports safe autocorrection (--autocorrect).
21
+ # Configuration parameters: EnforcedStyleAlignWith.
22
+ # SupportedStylesAlignWith: either, start_of_block, start_of_line
23
+ Layout/BlockAlignment:
24
+ Exclude:
25
+ - 'spec/moxml/config_spec.rb'
26
+
27
+ # Offense count: 1
28
+ # This cop supports safe autocorrection (--autocorrect).
29
+ Layout/BlockEndNewline:
30
+ Exclude:
31
+ - 'spec/moxml/config_spec.rb'
32
+
33
+ # Offense count: 1
34
+ # This cop supports safe autocorrection (--autocorrect).
35
+ Layout/ClosingParenthesisIndentation:
36
+ Exclude:
37
+ - 'spec/moxml/entity_registry_spec.rb'
38
+
39
+ # Offense count: 1
40
+ # This cop supports safe autocorrection (--autocorrect).
41
+ Layout/EmptyLineAfterGuardClause:
42
+ Exclude:
43
+ - 'lib/moxml/config.rb'
44
+
45
+ # Offense count: 1
46
+ # This cop supports safe autocorrection (--autocorrect).
47
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
48
+ # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
49
+ Layout/FirstArgumentIndentation:
50
+ Exclude:
51
+ - 'spec/moxml/entity_registry_spec.rb'
52
+
53
+ # Offense count: 2
10
54
  # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
55
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
56
+ # SupportedHashRocketStyles: key, separator, table
57
+ # SupportedColonStyles: key, separator, table
58
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
59
+ Layout/HashAlignment:
60
+ Exclude:
61
+ - 'spec/moxml/entity_registry_spec.rb'
62
+
63
+ # Offense count: 2
64
+ # This cop supports safe autocorrection (--autocorrect).
65
+ # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
66
+ # SupportedStylesAlignWith: start_of_line, relative_to_receiver
67
+ Layout/IndentationWidth:
68
+ Exclude:
69
+ - 'spec/moxml/config_spec.rb'
70
+
71
+ # Offense count: 238
72
+ # This cop supports safe autocorrection (--autocorrect).
73
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
12
74
  # URISchemes: http, https
13
75
  Layout/LineLength:
14
76
  Enabled: false
15
77
 
78
+ # Offense count: 1
79
+ # This cop supports safe autocorrection (--autocorrect).
80
+ # Configuration parameters: EnforcedStyle.
81
+ # SupportedStyles: symmetrical, new_line, same_line
82
+ Layout/MultilineMethodCallBraceLayout:
83
+ Exclude:
84
+ - 'spec/moxml/entity_registry_spec.rb'
85
+
86
+ # Offense count: 4
87
+ # This cop supports safe autocorrection (--autocorrect).
88
+ # Configuration parameters: AllowInHeredoc.
89
+ Layout/TrailingWhitespace:
90
+ Exclude:
91
+ - 'lib/moxml/config.rb'
92
+ - 'lib/moxml/entity_registry.rb'
93
+ - 'spec/moxml/entity_registry_spec.rb'
94
+
16
95
  # Offense count: 7
17
96
  # Configuration parameters: AllowedMethods.
18
97
  # AllowedMethods: enums
@@ -30,12 +109,26 @@ Lint/DuplicateBranch:
30
109
  - 'lib/moxml/adapter/libxml.rb'
31
110
  - 'lib/moxml/document.rb'
32
111
 
33
- # Offense count: 2
112
+ # Offense count: 3
34
113
  Lint/DuplicateMethods:
35
114
  Exclude:
115
+ - 'lib/moxml/config.rb'
36
116
  - 'lib/moxml/element.rb'
37
117
  - 'lib/moxml/node.rb'
38
118
 
119
+ # Offense count: 2
120
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
121
+ Lint/EmptyBlock:
122
+ Exclude:
123
+ - 'spec/moxml/xpath/axes_spec.rb'
124
+
125
+ # Offense count: 1
126
+ # This cop supports safe autocorrection (--autocorrect).
127
+ # Configuration parameters: AllowComments.
128
+ Lint/EmptyConditionalBody:
129
+ Exclude:
130
+ - 'spec/performance/xpath_benchmark_spec.rb'
131
+
39
132
  # Offense count: 1
40
133
  # Configuration parameters: AllowComments.
41
134
  Lint/EmptyWhen:
@@ -60,7 +153,7 @@ Lint/NoReturnInBeginEndBlocks:
60
153
  Exclude:
61
154
  - 'examples/api_client/api_client.rb'
62
155
 
63
- # Offense count: 93
156
+ # Offense count: 97
64
157
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
65
158
  Metrics/AbcSize:
66
159
  Enabled: false
@@ -76,12 +169,12 @@ Metrics/BlockLength:
76
169
  Metrics/BlockNesting:
77
170
  Max: 4
78
171
 
79
- # Offense count: 63
172
+ # Offense count: 65
80
173
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
81
174
  Metrics/CyclomaticComplexity:
82
175
  Enabled: false
83
176
 
84
- # Offense count: 164
177
+ # Offense count: 170
85
178
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
86
179
  Metrics/MethodLength:
87
180
  Max: 110
@@ -91,12 +184,12 @@ Metrics/MethodLength:
91
184
  Metrics/ParameterLists:
92
185
  Max: 7
93
186
 
94
- # Offense count: 43
187
+ # Offense count: 44
95
188
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
96
189
  Metrics/PerceivedComplexity:
97
190
  Enabled: false
98
191
 
99
- # Offense count: 15
192
+ # Offense count: 16
100
193
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
101
194
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
102
195
  Naming/MethodParameterName:
@@ -108,14 +201,16 @@ Naming/MethodParameterName:
108
201
  - 'lib/moxml/adapter/ox.rb'
109
202
  - 'lib/moxml/adapter/rexml.rb'
110
203
  - 'lib/moxml/attribute.rb'
204
+ - 'lib/moxml/node_set.rb'
111
205
  - 'lib/moxml/xpath/lexer.rb'
112
206
 
113
- # Offense count: 1
207
+ # Offense count: 2
114
208
  # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
115
209
  # AllowedMethods: call
116
- # WaywardPredicates: nonzero?
210
+ # WaywardPredicates: infinite?, nonzero?
117
211
  Naming/PredicateMethod:
118
212
  Exclude:
213
+ - 'lib/moxml/config.rb'
119
214
  - 'lib/moxml/xpath/ruby/node.rb'
120
215
 
121
216
  # Offense count: 46
@@ -131,35 +226,15 @@ RSpec/ContextWording:
131
226
  - 'spec/moxml/xpath/parser_spec.rb'
132
227
  - 'spec/performance/benchmark_spec.rb'
133
228
 
134
- # Offense count: 15
229
+ # Offense count: 16
135
230
  # Configuration parameters: IgnoredMetadata.
136
231
  RSpec/DescribeClass:
137
- Exclude:
138
- - '**/spec/features/**/*'
139
- - '**/spec/requests/**/*'
140
- - '**/spec/routing/**/*'
141
- - '**/spec/system/**/*'
142
- - '**/spec/views/**/*'
143
- - 'spec/consistency/adapter_parity_spec.rb'
144
- - 'spec/integration/all_adapters_spec.rb'
145
- - 'spec/integration/headed_ox_integration_spec.rb'
146
- - 'spec/moxml/declaration_preservation_spec.rb'
147
- - 'spec/moxml/error_spec.rb'
148
- - 'spec/moxml/xpath/axes_spec.rb'
149
- - 'spec/moxml/xpath/functions/boolean_functions_spec.rb'
150
- - 'spec/moxml/xpath/functions/node_functions_spec.rb'
151
- - 'spec/moxml/xpath/functions/numeric_functions_spec.rb'
152
- - 'spec/moxml/xpath/functions/position_functions_spec.rb'
153
- - 'spec/moxml/xpath/functions/special_functions_spec.rb'
154
- - 'spec/moxml/xpath/functions/string_functions_spec.rb'
155
- - 'spec/moxml/xpath/parser_integration_spec.rb'
156
- - 'spec/moxml/xpath_capabilities_spec.rb'
157
- - 'spec/performance/xpath_benchmark_spec.rb'
232
+ Enabled: false
158
233
 
159
- # Offense count: 217
234
+ # Offense count: 233
160
235
  # Configuration parameters: CountAsOne.
161
236
  RSpec/ExampleLength:
162
- Max: 85
237
+ Max: 64
163
238
 
164
239
  # Offense count: 1
165
240
  # This cop supports safe autocorrection (--autocorrect).
@@ -192,7 +267,7 @@ RSpec/LeakyConstantDeclaration:
192
267
  RSpec/MessageSpies:
193
268
  EnforcedStyle: receive
194
269
 
195
- # Offense count: 317
270
+ # Offense count: 327
196
271
  RSpec/MultipleExpectations:
197
272
  Max: 10
198
273
 
@@ -219,13 +294,15 @@ RSpec/PendingWithoutReason:
219
294
  - 'spec/moxml/xpath/functions/position_functions_spec.rb'
220
295
  - 'spec/moxml/xpath/functions/special_functions_spec.rb'
221
296
 
222
- # Offense count: 2
297
+ # Offense count: 4
223
298
  RSpec/RepeatedExample:
224
299
  Exclude:
225
300
  - 'spec/integration/shared_examples/node_wrappers/node_set_behavior.rb'
301
+ - 'spec/unit/rexml_isolated_test.rb'
226
302
 
227
303
  # Offense count: 10
228
- # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
304
+ # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
305
+ # SupportedInflectors: default, active_support
229
306
  RSpec/SpecFilePathFormat:
230
307
  Exclude:
231
308
  - '**/spec/routing/**/*'
@@ -240,6 +317,11 @@ RSpec/SpecFilePathFormat:
240
317
  - 'spec/moxml/xpath/ruby/node_spec.rb'
241
318
  - 'spec/moxml/xpath_spec.rb'
242
319
 
320
+ # Offense count: 1
321
+ RSpec/SpecFilePathSuffix:
322
+ Exclude:
323
+ - 'spec/unit/rexml_isolated_test.rb'
324
+
243
325
  # Offense count: 1
244
326
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
245
327
  RSpec/VerifiedDoubles:
@@ -251,6 +333,18 @@ Security/Eval:
251
333
  Exclude:
252
334
  - 'spec/moxml/xpath/ruby/generator_spec.rb'
253
335
 
336
+ # Offense count: 3
337
+ # This cop supports safe autocorrection (--autocorrect).
338
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
339
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
340
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
341
+ # FunctionalMethods: let, let!, subject, watch
342
+ # AllowedMethods: lambda, proc, it
343
+ Style/BlockDelimiters:
344
+ Exclude:
345
+ - 'spec/moxml/config_spec.rb'
346
+ - 'spec/moxml/entity_registry_spec.rb'
347
+
254
348
  # Offense count: 1
255
349
  Style/DocumentDynamicEvalDefinition:
256
350
  Exclude:
@@ -273,6 +367,26 @@ Style/MissingRespondToMissing:
273
367
  Exclude:
274
368
  - 'lib/moxml/xpath/ruby/node.rb'
275
369
 
370
+ # Offense count: 2
371
+ # This cop supports safe autocorrection (--autocorrect).
372
+ Style/MultilineIfModifier:
373
+ Exclude:
374
+ - 'lib/moxml/entity_registry.rb'
375
+
376
+ # Offense count: 1
377
+ # This cop supports safe autocorrection (--autocorrect).
378
+ Style/NilLambda:
379
+ Exclude:
380
+ - 'spec/moxml/entity_registry_spec.rb'
381
+
382
+ # Offense count: 5
383
+ # Configuration parameters: AllowedClasses.
384
+ Style/OneClassPerFile:
385
+ Exclude:
386
+ - 'examples/api_client/api_client.rb'
387
+ - 'examples/rss_parser/rss_parser.rb'
388
+ - 'examples/web_scraper/web_scraper.rb'
389
+
276
390
  # Offense count: 4
277
391
  # Configuration parameters: AllowedMethods.
278
392
  # AllowedMethods: respond_to_missing?
@@ -280,3 +394,11 @@ Style/OptionalBooleanParameter:
280
394
  Exclude:
281
395
  - 'lib/moxml/adapter/libxml.rb'
282
396
  - 'lib/moxml/xpath/compiler.rb'
397
+
398
+ # Offense count: 1
399
+ # This cop supports safe autocorrection (--autocorrect).
400
+ # Configuration parameters: EnforcedStyleForMultiline.
401
+ # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
402
+ Style/TrailingCommaInArguments:
403
+ Exclude:
404
+ - 'lib/moxml/context.rb'
data/Gemfile CHANGED
@@ -6,12 +6,13 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  # Provides iteration per second benchmarking for Ruby
9
+ gem "benchmark"
9
10
  gem "benchmark-ips"
10
11
  gem "get_process_mem"
11
12
  gem "libxml-ruby", "~> 5.0"
12
13
  gem "nokogiri", "~> 1.18"
13
14
  gem "oga", "~> 3.4"
14
- gem "openssl"
15
+ gem "openssl", "~> 3.0"
15
16
  gem "ox", "~> 2.14"
16
17
  gem "rake"
17
18
  gem "rexml"