moxml 0.1.9 → 0.1.11
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/.github/workflows/docs.yml +1 -1
- data/.github/workflows/rake.yml +16 -13
- data/.github/workflows/release.yml +1 -0
- data/.github/workflows/round-trip.yml +74 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +160 -38
- data/Gemfile +2 -1
- data/README.adoc +287 -20
- data/Rakefile +11 -0
- data/data/w3c_entities.json +2131 -0
- data/docs/ENTITY_SUPPORT_FOR_LUTAML_MODEL.md +102 -0
- data/docs/_guides/index.adoc +14 -12
- data/docs/_guides/node-api-consistency.adoc +572 -0
- data/docs/_guides/xml-declaration.adoc +5 -5
- data/docs/_pages/adapters/ox.adoc +30 -0
- data/docs/_pages/adapters/rexml.adoc +1 -1
- data/docs/_pages/configuration.adoc +43 -0
- data/docs/_pages/node-api-reference.adoc +128 -3
- data/docs/_tutorials/namespace-handling.adoc +21 -0
- data/examples/rss_parser/rss_parser.rb +1 -3
- data/lib/moxml/adapter/base.rb +26 -2
- data/lib/moxml/adapter/headed_ox.rb +5 -4
- data/lib/moxml/adapter/libxml.rb +18 -3
- data/lib/moxml/adapter/nokogiri.rb +26 -2
- data/lib/moxml/adapter/oga.rb +137 -20
- data/lib/moxml/adapter/ox.rb +29 -3
- data/lib/moxml/adapter/rexml.rb +54 -7
- data/lib/moxml/attribute.rb +6 -0
- data/lib/moxml/builder.rb +6 -0
- data/lib/moxml/config.rb +52 -1
- data/lib/moxml/context.rb +21 -2
- data/lib/moxml/doctype.rb +33 -0
- data/lib/moxml/document.rb +6 -1
- data/lib/moxml/document_builder.rb +45 -1
- data/lib/moxml/element.rb +10 -3
- data/lib/moxml/entity_reference.rb +29 -0
- data/lib/moxml/entity_registry.rb +278 -0
- data/lib/moxml/error.rb +5 -5
- data/lib/moxml/node.rb +22 -8
- data/lib/moxml/node_set.rb +10 -6
- data/lib/moxml/processing_instruction.rb +6 -0
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml/xml_utils.rb +25 -2
- data/lib/moxml/xpath/errors.rb +1 -1
- data/lib/moxml.rb +1 -0
- data/spec/consistency/README.md +3 -1
- data/spec/consistency/round_trip_spec.rb +479 -0
- data/spec/examples/readme_examples_spec.rb +1 -1
- data/spec/fixtures/round-trips/metanorma/a.xml +66 -0
- data/spec/fixtures/round-trips/metanorma/bilingual-en.xml +7682 -0
- data/spec/fixtures/round-trips/metanorma/bilingual-fr.xml +7520 -0
- data/spec/fixtures/round-trips/metanorma/bilingual.presentation.xml +21211 -0
- data/spec/fixtures/round-trips/metanorma/collection1.xml +313 -0
- data/spec/fixtures/round-trips/metanorma/collection1nested.xml +291 -0
- data/spec/fixtures/round-trips/metanorma/collection_docinline.xml +544 -0
- data/spec/fixtures/round-trips/metanorma/collection_full.xml +1776 -0
- data/spec/fixtures/round-trips/metanorma/dummy.1.xml +295 -0
- data/spec/fixtures/round-trips/metanorma/dummy.xml +349 -0
- data/spec/fixtures/round-trips/metanorma/footnotes.xml +70 -0
- data/spec/fixtures/round-trips/metanorma/iho.xml +116 -0
- data/spec/fixtures/round-trips/metanorma/rice-amd.final.xml +186 -0
- data/spec/fixtures/round-trips/metanorma/rice-amd.final_1.xml +180 -0
- data/spec/fixtures/round-trips/metanorma/rice-en.final.norepo.xml +116 -0
- data/spec/fixtures/round-trips/metanorma/rice-en.final.xml +149 -0
- data/spec/fixtures/round-trips/metanorma/rice-en.final_1.xml +144 -0
- data/spec/fixtures/round-trips/metanorma/rice1-en.final.xml +120 -0
- data/spec/fixtures/round-trips/metanorma/rice2-en.final.xml +116 -0
- data/spec/fixtures/round-trips/metanorma/test_sectionsplit.xml +119 -0
- data/spec/fixtures/round-trips/niso-jats/bmj_sample.xml +1068 -0
- data/spec/fixtures/round-trips/niso-jats/element_citation.xml +7 -0
- data/spec/fixtures/round-trips/niso-jats/pnas_sample.xml +3768 -0
- data/spec/fixtures/round-trips/rfcxml/rfc8881.xml +45848 -0
- data/spec/fixtures/round-trips/rfcxml/rfc8994.xml +6607 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9000.xml +9064 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9043.xml +5527 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9051.xml +14286 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9110.xml +18156 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9260.xml +9136 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9293.xml +8300 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9380.xml +8916 -0
- data/spec/fixtures/round-trips/rfcxml/rfc9420.xml +8927 -0
- data/spec/fixtures/w3c/namespaces/1.0/001.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/002.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/003.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/004.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/005.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/006.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/007.xml +20 -0
- data/spec/fixtures/w3c/namespaces/1.0/008.xml +20 -0
- data/spec/fixtures/w3c/namespaces/1.0/009.xml +19 -0
- data/spec/fixtures/w3c/namespaces/1.0/010.xml +19 -0
- data/spec/fixtures/w3c/namespaces/1.0/011.xml +20 -0
- data/spec/fixtures/w3c/namespaces/1.0/012.xml +19 -0
- data/spec/fixtures/w3c/namespaces/1.0/013.xml +5 -0
- data/spec/fixtures/w3c/namespaces/1.0/014.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/015.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/016.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/017.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/018.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/019.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/020.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/021.xml +6 -0
- data/spec/fixtures/w3c/namespaces/1.0/022.xml +6 -0
- data/spec/fixtures/w3c/namespaces/1.0/023.xml +6 -0
- data/spec/fixtures/w3c/namespaces/1.0/024.xml +6 -0
- data/spec/fixtures/w3c/namespaces/1.0/025.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/026.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/027.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/028.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/029.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/030.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/031.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/032.xml +5 -0
- data/spec/fixtures/w3c/namespaces/1.0/033.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/034.xml +3 -0
- data/spec/fixtures/w3c/namespaces/1.0/035.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/036.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/037.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/038.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/039.xml +10 -0
- data/spec/fixtures/w3c/namespaces/1.0/040.xml +9 -0
- data/spec/fixtures/w3c/namespaces/1.0/041.xml +8 -0
- data/spec/fixtures/w3c/namespaces/1.0/042.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/043.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/044.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/045.xml +7 -0
- data/spec/fixtures/w3c/namespaces/1.0/046.xml +10 -0
- data/spec/fixtures/w3c/namespaces/1.0/047.xml +4 -0
- data/spec/fixtures/w3c/namespaces/1.0/048.xml +5 -0
- data/spec/fixtures/w3c/namespaces/1.0/LICENSE.md +32 -0
- data/spec/fixtures/w3c/namespaces/1.0/README.adoc +42 -0
- data/spec/fixtures/w3c/namespaces/1.0/rmt-ns10.xml +156 -0
- data/spec/integration/shared_examples/node_wrappers/namespace_behavior.rb +14 -2
- data/spec/integration/shared_examples/w3c_namespace_examples.rb +10 -0
- data/spec/integration/w3c_namespace_spec.rb +69 -0
- data/spec/moxml/adapter/libxml_spec.rb +7 -1
- data/spec/moxml/adapter/oga_spec.rb +92 -0
- data/spec/moxml/config_spec.rb +75 -0
- data/spec/moxml/doctype_spec.rb +19 -3
- data/spec/moxml/entity_registry_spec.rb +184 -0
- data/spec/moxml/error_spec.rb +2 -2
- data/spec/moxml/namespace_uri_validation_spec.rb +140 -0
- data/spec/moxml/xpath/axes_spec.rb +3 -4
- data/spec/performance/xpath_benchmark_spec.rb +6 -54
- data/spec/support/w3c_namespace_helpers.rb +41 -0
- data/spec/unit/rexml_isolated_test.rb +271 -0
- metadata +99 -3
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22ee4b9d877466a93b1253a05f5b64f65cb637335f8e5a02b02c357fd87b505d
|
|
4
|
+
data.tar.gz: 90c377d7eac0bd5bb9e15393b00c3cfa9e8b5b4eeb80f56d6f52ccb7e11b5774
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73b2b180410acadc4be69bd87948f5966cdd8c8c2480bf61cb66f212e7cd893a6ab31e536f8922dde8814a6e04e57b794206d504b8a479e68288b714b2396ddb
|
|
7
|
+
data.tar.gz: ec4a72fc0c930dc2abfef2719dea6cce1ff37efb00e0255f46828f624aaab4007c9f523d39f86680a01f49a8a3a1c4f184319dd6fc6381562bd151167f22f780
|
data/.github/workflows/docs.yml
CHANGED
data/.github/workflows/rake.yml
CHANGED
|
@@ -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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
@@ -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
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,18 +1,97 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
172
|
+
# Offense count: 65
|
|
80
173
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
81
174
|
Metrics/CyclomaticComplexity:
|
|
82
175
|
Enabled: false
|
|
83
176
|
|
|
84
|
-
# Offense count:
|
|
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:
|
|
187
|
+
# Offense count: 44
|
|
95
188
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
96
189
|
Metrics/PerceivedComplexity:
|
|
97
190
|
Enabled: false
|
|
98
191
|
|
|
99
|
-
# Offense count:
|
|
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:
|
|
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:
|
|
229
|
+
# Offense count: 16
|
|
135
230
|
# Configuration parameters: IgnoredMetadata.
|
|
136
231
|
RSpec/DescribeClass:
|
|
137
|
-
|
|
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:
|
|
234
|
+
# Offense count: 233
|
|
160
235
|
# Configuration parameters: CountAsOne.
|
|
161
236
|
RSpec/ExampleLength:
|
|
162
|
-
Max:
|
|
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:
|
|
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:
|
|
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"
|