moxml 0.1.7 → 0.1.9
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/dependent-repos.json +5 -0
- data/.github/workflows/dependent-tests.yml +20 -0
- data/.github/workflows/docs.yml +59 -0
- data/.github/workflows/rake.yml +10 -10
- data/.github/workflows/release.yml +5 -3
- data/.gitignore +37 -0
- data/.rubocop.yml +15 -7
- data/.rubocop_todo.yml +224 -43
- data/Gemfile +14 -9
- data/LICENSE.md +6 -2
- data/README.adoc +535 -373
- data/Rakefile +53 -0
- data/benchmarks/.gitignore +6 -0
- data/benchmarks/generate_report.rb +550 -0
- data/docs/Gemfile +13 -0
- data/docs/_config.yml +138 -0
- data/docs/_guides/advanced-features.adoc +87 -0
- data/docs/_guides/development-testing.adoc +165 -0
- data/docs/_guides/index.adoc +51 -0
- data/docs/_guides/modifying-xml.adoc +292 -0
- data/docs/_guides/parsing-xml.adoc +230 -0
- data/docs/_guides/sax-parsing.adoc +603 -0
- data/docs/_guides/working-with-documents.adoc +118 -0
- data/docs/_guides/xml-declaration.adoc +450 -0
- data/docs/_pages/adapter-compatibility.adoc +369 -0
- data/docs/_pages/adapters/headed-ox.adoc +237 -0
- data/docs/_pages/adapters/index.adoc +97 -0
- data/docs/_pages/adapters/libxml.adoc +285 -0
- data/docs/_pages/adapters/nokogiri.adoc +251 -0
- data/docs/_pages/adapters/oga.adoc +291 -0
- data/docs/_pages/adapters/ox.adoc +56 -0
- data/docs/_pages/adapters/rexml.adoc +292 -0
- data/docs/_pages/best-practices.adoc +429 -0
- data/docs/_pages/compatibility.adoc +467 -0
- data/docs/_pages/configuration.adoc +250 -0
- data/docs/_pages/error-handling.adoc +349 -0
- data/docs/_pages/headed-ox-limitations.adoc +574 -0
- data/docs/_pages/headed-ox.adoc +1025 -0
- data/docs/_pages/index.adoc +35 -0
- data/docs/_pages/installation.adoc +140 -0
- data/docs/_pages/node-api-reference.adoc +49 -0
- data/docs/_pages/performance.adoc +35 -0
- data/docs/_pages/quick-start.adoc +243 -0
- data/docs/_pages/thread-safety.adoc +28 -0
- data/docs/_references/document-api.adoc +407 -0
- data/docs/_references/index.adoc +48 -0
- data/docs/_tutorials/basic-usage.adoc +267 -0
- data/docs/_tutorials/builder-pattern.adoc +342 -0
- data/docs/_tutorials/index.adoc +33 -0
- data/docs/_tutorials/namespace-handling.adoc +324 -0
- data/docs/_tutorials/xpath-queries.adoc +358 -0
- data/docs/index.adoc +122 -0
- data/examples/README.md +124 -0
- data/examples/api_client/README.md +424 -0
- data/examples/api_client/api_client.rb +394 -0
- data/examples/api_client/example_response.xml +48 -0
- data/examples/headed_ox_example/README.md +90 -0
- data/examples/headed_ox_example/headed_ox_demo.rb +71 -0
- data/examples/rss_parser/README.md +194 -0
- data/examples/rss_parser/example_feed.xml +93 -0
- data/examples/rss_parser/rss_parser.rb +189 -0
- data/examples/sax_parsing/README.md +50 -0
- data/examples/sax_parsing/data_extractor.rb +75 -0
- data/examples/sax_parsing/example.xml +21 -0
- data/examples/sax_parsing/large_file.rb +78 -0
- data/examples/sax_parsing/simple_parser.rb +55 -0
- data/examples/web_scraper/README.md +352 -0
- data/examples/web_scraper/example_page.html +201 -0
- data/examples/web_scraper/web_scraper.rb +312 -0
- data/lib/moxml/adapter/base.rb +107 -28
- data/lib/moxml/adapter/customized_libxml/cdata.rb +28 -0
- data/lib/moxml/adapter/customized_libxml/comment.rb +24 -0
- data/lib/moxml/adapter/customized_libxml/declaration.rb +85 -0
- data/lib/moxml/adapter/customized_libxml/element.rb +39 -0
- data/lib/moxml/adapter/customized_libxml/node.rb +44 -0
- data/lib/moxml/adapter/customized_libxml/processing_instruction.rb +31 -0
- data/lib/moxml/adapter/customized_libxml/text.rb +27 -0
- data/lib/moxml/adapter/customized_oga/xml_generator.rb +1 -1
- data/lib/moxml/adapter/customized_ox/attribute.rb +28 -1
- data/lib/moxml/adapter/customized_rexml/formatter.rb +13 -8
- data/lib/moxml/adapter/headed_ox.rb +161 -0
- data/lib/moxml/adapter/libxml.rb +1564 -0
- data/lib/moxml/adapter/nokogiri.rb +156 -9
- data/lib/moxml/adapter/oga.rb +190 -15
- data/lib/moxml/adapter/ox.rb +322 -28
- data/lib/moxml/adapter/rexml.rb +157 -28
- data/lib/moxml/adapter.rb +21 -4
- data/lib/moxml/attribute.rb +6 -0
- data/lib/moxml/builder.rb +40 -4
- data/lib/moxml/config.rb +8 -3
- data/lib/moxml/context.rb +57 -2
- data/lib/moxml/declaration.rb +9 -0
- data/lib/moxml/doctype.rb +13 -1
- data/lib/moxml/document.rb +53 -6
- data/lib/moxml/document_builder.rb +34 -5
- data/lib/moxml/element.rb +71 -2
- data/lib/moxml/error.rb +175 -6
- data/lib/moxml/node.rb +155 -4
- data/lib/moxml/node_set.rb +34 -0
- data/lib/moxml/sax/block_handler.rb +194 -0
- data/lib/moxml/sax/element_handler.rb +124 -0
- data/lib/moxml/sax/handler.rb +113 -0
- data/lib/moxml/sax.rb +31 -0
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml/xml_utils/encoder.rb +4 -4
- data/lib/moxml/xml_utils.rb +7 -4
- data/lib/moxml/xpath/ast/node.rb +159 -0
- data/lib/moxml/xpath/cache.rb +91 -0
- data/lib/moxml/xpath/compiler.rb +1770 -0
- data/lib/moxml/xpath/context.rb +26 -0
- data/lib/moxml/xpath/conversion.rb +124 -0
- data/lib/moxml/xpath/engine.rb +52 -0
- data/lib/moxml/xpath/errors.rb +101 -0
- data/lib/moxml/xpath/lexer.rb +304 -0
- data/lib/moxml/xpath/parser.rb +485 -0
- data/lib/moxml/xpath/ruby/generator.rb +269 -0
- data/lib/moxml/xpath/ruby/node.rb +193 -0
- data/lib/moxml/xpath.rb +37 -0
- data/lib/moxml.rb +5 -2
- data/moxml.gemspec +3 -1
- data/old-specs/moxml/adapter/customized_libxml/.gitkeep +6 -0
- data/spec/consistency/README.md +77 -0
- data/spec/{moxml/examples/adapter_spec.rb → consistency/adapter_parity_spec.rb} +4 -4
- data/spec/examples/README.md +75 -0
- data/spec/{support/shared_examples/examples/attribute.rb → examples/attribute_examples_spec.rb} +1 -1
- data/spec/{support/shared_examples/examples/basic_usage.rb → examples/basic_usage_spec.rb} +2 -2
- data/spec/{support/shared_examples/examples/namespace.rb → examples/namespace_examples_spec.rb} +3 -3
- data/spec/{support/shared_examples/examples/readme_examples.rb → examples/readme_examples_spec.rb} +6 -4
- data/spec/{support/shared_examples/examples/xpath.rb → examples/xpath_examples_spec.rb} +10 -6
- data/spec/integration/README.md +71 -0
- data/spec/{moxml/all_with_adapters_spec.rb → integration/all_adapters_spec.rb} +3 -2
- data/spec/integration/headed_ox_integration_spec.rb +326 -0
- data/spec/{support → integration}/shared_examples/edge_cases.rb +37 -10
- data/spec/integration/shared_examples/high_level/.gitkeep +0 -0
- data/spec/{support/shared_examples/context.rb → integration/shared_examples/high_level/context_behavior.rb} +2 -1
- data/spec/{support/shared_examples/integration.rb → integration/shared_examples/integration_workflows.rb} +23 -6
- data/spec/integration/shared_examples/node_wrappers/.gitkeep +0 -0
- data/spec/{support/shared_examples/cdata.rb → integration/shared_examples/node_wrappers/cdata_behavior.rb} +6 -1
- data/spec/{support/shared_examples/comment.rb → integration/shared_examples/node_wrappers/comment_behavior.rb} +2 -1
- data/spec/{support/shared_examples/declaration.rb → integration/shared_examples/node_wrappers/declaration_behavior.rb} +5 -5
- data/spec/{support/shared_examples/doctype.rb → integration/shared_examples/node_wrappers/doctype_behavior.rb} +2 -2
- data/spec/{support/shared_examples/document.rb → integration/shared_examples/node_wrappers/document_behavior.rb} +1 -1
- data/spec/{support/shared_examples/node.rb → integration/shared_examples/node_wrappers/node_behavior.rb} +9 -2
- data/spec/{support/shared_examples/node_set.rb → integration/shared_examples/node_wrappers/node_set_behavior.rb} +1 -18
- data/spec/{support/shared_examples/processing_instruction.rb → integration/shared_examples/node_wrappers/processing_instruction_behavior.rb} +6 -2
- data/spec/moxml/README.md +41 -0
- data/spec/moxml/adapter/.gitkeep +0 -0
- data/spec/moxml/adapter/README.md +61 -0
- data/spec/moxml/adapter/base_spec.rb +27 -0
- data/spec/moxml/adapter/headed_ox_spec.rb +311 -0
- data/spec/moxml/adapter/libxml_spec.rb +14 -0
- data/spec/moxml/adapter/ox_spec.rb +9 -8
- data/spec/moxml/adapter/shared_examples/.gitkeep +0 -0
- data/spec/{support/shared_examples/xml_adapter.rb → moxml/adapter/shared_examples/adapter_contract.rb} +39 -12
- data/spec/moxml/adapter_spec.rb +16 -0
- data/spec/moxml/attribute_spec.rb +30 -0
- data/spec/moxml/builder_spec.rb +33 -0
- data/spec/moxml/cdata_spec.rb +31 -0
- data/spec/moxml/comment_spec.rb +31 -0
- data/spec/moxml/config_spec.rb +3 -3
- data/spec/moxml/context_spec.rb +28 -0
- data/spec/moxml/declaration_preservation_spec.rb +217 -0
- data/spec/moxml/declaration_spec.rb +36 -0
- data/spec/moxml/doctype_spec.rb +33 -0
- data/spec/moxml/document_builder_spec.rb +30 -0
- data/spec/moxml/document_spec.rb +105 -0
- data/spec/moxml/element_spec.rb +143 -0
- data/spec/moxml/error_spec.rb +266 -22
- data/spec/{moxml_spec.rb → moxml/moxml_spec.rb} +9 -9
- data/spec/moxml/namespace_spec.rb +32 -0
- data/spec/moxml/node_set_spec.rb +39 -0
- data/spec/moxml/node_spec.rb +37 -0
- data/spec/moxml/processing_instruction_spec.rb +34 -0
- data/spec/moxml/sax_spec.rb +1067 -0
- data/spec/moxml/text_spec.rb +31 -0
- data/spec/moxml/version_spec.rb +14 -0
- data/spec/moxml/xml_utils/.gitkeep +0 -0
- data/spec/moxml/xml_utils/encoder_spec.rb +27 -0
- data/spec/moxml/xml_utils_spec.rb +49 -0
- data/spec/moxml/xpath/ast/node_spec.rb +83 -0
- data/spec/moxml/xpath/axes_spec.rb +296 -0
- data/spec/moxml/xpath/cache_spec.rb +358 -0
- data/spec/moxml/xpath/compiler_spec.rb +406 -0
- data/spec/moxml/xpath/context_spec.rb +210 -0
- data/spec/moxml/xpath/conversion_spec.rb +365 -0
- data/spec/moxml/xpath/fixtures/sample.xml +25 -0
- data/spec/moxml/xpath/functions/boolean_functions_spec.rb +114 -0
- data/spec/moxml/xpath/functions/node_functions_spec.rb +145 -0
- data/spec/moxml/xpath/functions/numeric_functions_spec.rb +164 -0
- data/spec/moxml/xpath/functions/position_functions_spec.rb +93 -0
- data/spec/moxml/xpath/functions/special_functions_spec.rb +89 -0
- data/spec/moxml/xpath/functions/string_functions_spec.rb +381 -0
- data/spec/moxml/xpath/lexer_spec.rb +488 -0
- data/spec/moxml/xpath/parser_integration_spec.rb +210 -0
- data/spec/moxml/xpath/parser_spec.rb +364 -0
- data/spec/moxml/xpath/ruby/generator_spec.rb +421 -0
- data/spec/moxml/xpath/ruby/node_spec.rb +291 -0
- data/spec/moxml/xpath_capabilities_spec.rb +199 -0
- data/spec/moxml/xpath_spec.rb +77 -0
- data/spec/performance/README.md +83 -0
- data/spec/performance/benchmark_spec.rb +64 -0
- data/spec/{support/shared_examples/examples/memory.rb → performance/memory_usage_spec.rb} +4 -1
- data/spec/{support/shared_examples/examples/thread_safety.rb → performance/thread_safety_spec.rb} +3 -1
- data/spec/performance/xpath_benchmark_spec.rb +259 -0
- data/spec/spec_helper.rb +58 -1
- data/spec/support/xml_matchers.rb +1 -1
- metadata +178 -34
- data/spec/support/shared_examples/examples/benchmark_spec.rb +0 -51
- /data/spec/{support/shared_examples/builder.rb → integration/shared_examples/high_level/builder_behavior.rb} +0 -0
- /data/spec/{support/shared_examples/document_builder.rb → integration/shared_examples/high_level/document_builder_behavior.rb} +0 -0
- /data/spec/{support/shared_examples/attribute.rb → integration/shared_examples/node_wrappers/attribute_behavior.rb} +0 -0
- /data/spec/{support/shared_examples/element.rb → integration/shared_examples/node_wrappers/element_behavior.rb} +0 -0
- /data/spec/{support/shared_examples/namespace.rb → integration/shared_examples/node_wrappers/namespace_behavior.rb} +0 -0
- /data/spec/{support/shared_examples/text.rb → integration/shared_examples/node_wrappers/text_behavior.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b2faed71c75f32fcfe528621b1d3ed01c603b04f81e75d5b45b6c525d9d1836
|
|
4
|
+
data.tar.gz: 68ead788c2e5098b2f1f88653443fe4d8ff1e76b17dab09c08badb64c7ab70a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8aa59a486d44d101e1c078fc6fde2eea1cad9d4d7690d937dc7faef233a4143206432ffab53da3a2ef01af9245d17f706ddb01bc55b2c3555b358a6a3df10143
|
|
7
|
+
data.tar.gz: b5256089daef1f94012046bd7ff0fcbff1827c615b46d416231933de3193f3a262063a6ad761a87c629cdfe15fc51644fc1887d43eaeff5f8710bd16a791ea3c
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: dependent-gems-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
tags: [ v* ]
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- '**.adoc'
|
|
9
|
+
pull_request:
|
|
10
|
+
paths-ignore:
|
|
11
|
+
- '**.adoc'
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
repository_dispatch:
|
|
14
|
+
types: [ release-passed ]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
rake:
|
|
18
|
+
uses: metanorma/ci/.github/workflows/dependent-rake.yml@main
|
|
19
|
+
with:
|
|
20
|
+
command: bundle exec rspec
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
repository_dispatch:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
pages: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Setup Ruby
|
|
27
|
+
uses: ruby/setup-ruby@v1
|
|
28
|
+
with:
|
|
29
|
+
ruby-version: '3.3'
|
|
30
|
+
bundler-cache: true
|
|
31
|
+
cache-version: 0
|
|
32
|
+
working-directory: docs
|
|
33
|
+
|
|
34
|
+
- name: Setup Pages
|
|
35
|
+
id: pages
|
|
36
|
+
uses: actions/configure-pages@v5
|
|
37
|
+
|
|
38
|
+
- name: Build with Jekyll
|
|
39
|
+
run: bundle exec jekyll build --verbose --trace --baseurl "${{ steps.pages.outputs.base_path }}"
|
|
40
|
+
working-directory: docs
|
|
41
|
+
env:
|
|
42
|
+
JEKYLL_ENV: production
|
|
43
|
+
|
|
44
|
+
- name: Upload artifact
|
|
45
|
+
uses: actions/upload-pages-artifact@v3
|
|
46
|
+
with:
|
|
47
|
+
path: docs/_site
|
|
48
|
+
|
|
49
|
+
deploy:
|
|
50
|
+
environment:
|
|
51
|
+
name: github-pages
|
|
52
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
53
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
needs: build
|
|
56
|
+
steps:
|
|
57
|
+
- name: Deploy to GitHub Pages
|
|
58
|
+
id: deployment
|
|
59
|
+
uses: actions/deploy-pages@v4
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
1
|
name: rake
|
|
4
2
|
|
|
3
|
+
permissions:
|
|
4
|
+
contents: write
|
|
5
|
+
|
|
5
6
|
on:
|
|
6
7
|
push:
|
|
7
|
-
branches: [
|
|
8
|
+
branches: [ main ]
|
|
8
9
|
tags: [ v* ]
|
|
9
10
|
pull_request:
|
|
10
11
|
|
|
@@ -13,11 +14,10 @@ jobs:
|
|
|
13
14
|
uses: metanorma/ci/.github/workflows/generic-rake.yml@main
|
|
14
15
|
with:
|
|
15
16
|
before-setup-ruby: |
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
echo "---"
|
|
20
|
-
echo '
|
|
21
|
-
cat .bundle/config
|
|
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
22
|
secrets:
|
|
23
|
-
pat_token: ${{ secrets.
|
|
23
|
+
pat_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
1
|
name: release
|
|
4
2
|
|
|
3
|
+
permissions:
|
|
4
|
+
contents: write
|
|
5
|
+
packages: write
|
|
6
|
+
|
|
5
7
|
on:
|
|
6
8
|
workflow_dispatch:
|
|
7
9
|
inputs:
|
|
@@ -20,4 +22,4 @@ jobs:
|
|
|
20
22
|
next_version: ${{ github.event.inputs.next_version }}
|
|
21
23
|
secrets:
|
|
22
24
|
rubygems-api-key: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
|
|
23
|
-
pat_token: ${{ secrets.
|
|
25
|
+
pat_token: ${{ secrets.GITHUB_TOKEN }}
|
data/.gitignore
CHANGED
|
@@ -11,3 +11,40 @@ Gemfile.lock
|
|
|
11
11
|
# rspec failure tracking
|
|
12
12
|
.rspec_status
|
|
13
13
|
/spec/examples.txt
|
|
14
|
+
|
|
15
|
+
# Temporary test files
|
|
16
|
+
test_*.rb
|
|
17
|
+
test_*.txt
|
|
18
|
+
debug_*.rb
|
|
19
|
+
|
|
20
|
+
# Temporary status and documentation files
|
|
21
|
+
*_STATUS.md
|
|
22
|
+
*_KNOWN_ISSUES.md
|
|
23
|
+
libxml_*.txt
|
|
24
|
+
*_failures.txt
|
|
25
|
+
*_output.txt
|
|
26
|
+
*_results.txt
|
|
27
|
+
|
|
28
|
+
# Generated benchmark reports (machine-specific)
|
|
29
|
+
/benchmarks/PERFORMANCE_REPORT.md
|
|
30
|
+
|
|
31
|
+
# IDE and editor files
|
|
32
|
+
.vscode/
|
|
33
|
+
.idea/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
*~
|
|
37
|
+
.DS_Store
|
|
38
|
+
/.kilocode
|
|
39
|
+
/*.md
|
|
40
|
+
|
|
41
|
+
.rubocop-https*
|
|
42
|
+
|
|
43
|
+
# Ruby version managers
|
|
44
|
+
.ruby-version.lock
|
|
45
|
+
.rvmrc
|
|
46
|
+
|
|
47
|
+
# Artifacts from static site generators
|
|
48
|
+
/_site
|
|
49
|
+
/docs/_site
|
|
50
|
+
/docs/.jekyll-cache
|
data/.rubocop.yml
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
inherit_from:
|
|
1
|
+
inherit_from:
|
|
2
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
3
|
+
- .rubocop_todo.yml
|
|
4
|
+
|
|
5
|
+
plugins:
|
|
6
|
+
- rubocop-performance
|
|
7
|
+
- rubocop-rake
|
|
8
|
+
- rubocop-rspec
|
|
2
9
|
|
|
3
10
|
AllCops:
|
|
4
11
|
TargetRubyVersion: 3.0
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
NewCops: enable
|
|
13
|
+
SuggestExtensions: false
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'debug_*.rb'
|
|
16
|
+
- 'test_*.rb'
|
|
17
|
+
- 'vendor/**/*'
|
|
18
|
+
- 'tmp/**/*'
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,89 +1,266 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-
|
|
3
|
+
# on 2025-11-24 13:45:20 UTC using RuboCop version 1.80.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:
|
|
10
|
-
|
|
9
|
+
# Offense count: 192
|
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
12
|
+
# URISchemes: http, https
|
|
13
|
+
Layout/LineLength:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
# Offense count: 7
|
|
17
|
+
# Configuration parameters: AllowedMethods.
|
|
18
|
+
# AllowedMethods: enums
|
|
19
|
+
Lint/ConstantDefinitionInBlock:
|
|
11
20
|
Exclude:
|
|
21
|
+
- 'spec/moxml/declaration_preservation_spec.rb'
|
|
22
|
+
- 'spec/moxml/sax_spec.rb'
|
|
23
|
+
|
|
24
|
+
# Offense count: 6
|
|
25
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
|
|
26
|
+
Lint/DuplicateBranch:
|
|
27
|
+
Exclude:
|
|
28
|
+
- 'benchmarks/generate_report.rb'
|
|
29
|
+
- 'lib/moxml/adapter/customized_libxml/declaration.rb'
|
|
30
|
+
- 'lib/moxml/adapter/libxml.rb'
|
|
31
|
+
- 'lib/moxml/document.rb'
|
|
32
|
+
|
|
33
|
+
# Offense count: 2
|
|
34
|
+
Lint/DuplicateMethods:
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'lib/moxml/element.rb'
|
|
12
37
|
- 'lib/moxml/node.rb'
|
|
13
38
|
|
|
14
39
|
# Offense count: 1
|
|
15
|
-
# Configuration parameters:
|
|
16
|
-
Lint/
|
|
40
|
+
# Configuration parameters: AllowComments.
|
|
41
|
+
Lint/EmptyWhen:
|
|
17
42
|
Exclude:
|
|
18
|
-
- 'lib/moxml/
|
|
43
|
+
- 'lib/moxml/xpath/compiler.rb'
|
|
19
44
|
|
|
20
|
-
# Offense count:
|
|
45
|
+
# Offense count: 1
|
|
46
|
+
Lint/IneffectiveAccessModifier:
|
|
47
|
+
Exclude:
|
|
48
|
+
- 'lib/moxml/node.rb'
|
|
49
|
+
|
|
50
|
+
# Offense count: 3
|
|
21
51
|
# Configuration parameters: AllowedParentClasses.
|
|
22
52
|
Lint/MissingSuper:
|
|
23
53
|
Exclude:
|
|
24
54
|
- 'lib/moxml/adapter/customized_oga/xml_declaration.rb'
|
|
25
55
|
- 'lib/moxml/adapter/customized_rexml/formatter.rb'
|
|
56
|
+
- 'spec/moxml/xpath/ast/node_spec.rb'
|
|
57
|
+
|
|
58
|
+
# Offense count: 2
|
|
59
|
+
Lint/NoReturnInBeginEndBlocks:
|
|
60
|
+
Exclude:
|
|
61
|
+
- 'examples/api_client/api_client.rb'
|
|
26
62
|
|
|
27
|
-
# Offense count:
|
|
28
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
63
|
+
# Offense count: 93
|
|
64
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
29
65
|
Metrics/AbcSize:
|
|
30
|
-
|
|
66
|
+
Enabled: false
|
|
31
67
|
|
|
32
|
-
# Offense count:
|
|
33
|
-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
68
|
+
# Offense count: 7
|
|
69
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
34
70
|
# AllowedMethods: refine
|
|
35
71
|
Metrics/BlockLength:
|
|
36
|
-
Max:
|
|
72
|
+
Max: 90
|
|
37
73
|
|
|
38
74
|
# Offense count: 5
|
|
39
|
-
# Configuration parameters:
|
|
40
|
-
Metrics/
|
|
41
|
-
Max:
|
|
75
|
+
# Configuration parameters: CountBlocks, CountModifierForms.
|
|
76
|
+
Metrics/BlockNesting:
|
|
77
|
+
Max: 4
|
|
42
78
|
|
|
43
|
-
# Offense count:
|
|
44
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
79
|
+
# Offense count: 63
|
|
80
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
45
81
|
Metrics/CyclomaticComplexity:
|
|
46
|
-
|
|
82
|
+
Enabled: false
|
|
47
83
|
|
|
48
|
-
# Offense count:
|
|
84
|
+
# Offense count: 164
|
|
49
85
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
50
86
|
Metrics/MethodLength:
|
|
51
|
-
Max:
|
|
87
|
+
Max: 110
|
|
52
88
|
|
|
53
89
|
# Offense count: 3
|
|
54
|
-
# Configuration parameters:
|
|
90
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
|
91
|
+
Metrics/ParameterLists:
|
|
92
|
+
Max: 7
|
|
93
|
+
|
|
94
|
+
# Offense count: 42
|
|
95
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
55
96
|
Metrics/PerceivedComplexity:
|
|
56
|
-
|
|
97
|
+
Enabled: false
|
|
57
98
|
|
|
58
|
-
# Offense count:
|
|
99
|
+
# Offense count: 15
|
|
59
100
|
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
60
101
|
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
61
102
|
Naming/MethodParameterName:
|
|
62
103
|
Exclude:
|
|
104
|
+
- 'benchmarks/generate_report.rb'
|
|
63
105
|
- 'lib/moxml/adapter/customized_oga/xml_generator.rb'
|
|
106
|
+
- 'lib/moxml/adapter/libxml.rb'
|
|
64
107
|
- 'lib/moxml/adapter/nokogiri.rb'
|
|
65
108
|
- 'lib/moxml/adapter/ox.rb'
|
|
66
109
|
- 'lib/moxml/adapter/rexml.rb'
|
|
67
110
|
- 'lib/moxml/attribute.rb'
|
|
111
|
+
- 'lib/moxml/xpath/lexer.rb'
|
|
68
112
|
|
|
69
113
|
# Offense count: 1
|
|
70
|
-
#
|
|
71
|
-
|
|
114
|
+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
|
|
115
|
+
# AllowedMethods: call
|
|
116
|
+
# WaywardPredicates: nonzero?
|
|
117
|
+
Naming/PredicateMethod:
|
|
72
118
|
Exclude:
|
|
73
|
-
- 'lib/moxml/
|
|
119
|
+
- 'lib/moxml/xpath/ruby/node.rb'
|
|
74
120
|
|
|
75
|
-
# Offense count:
|
|
76
|
-
# Configuration parameters:
|
|
77
|
-
|
|
78
|
-
|
|
121
|
+
# Offense count: 46
|
|
122
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
|
123
|
+
# Prefixes: when, with, without
|
|
124
|
+
RSpec/ContextWording:
|
|
125
|
+
Exclude:
|
|
126
|
+
- 'spec/integration/headed_ox_integration_spec.rb'
|
|
127
|
+
- 'spec/moxml/adapter/headed_ox_spec.rb'
|
|
128
|
+
- 'spec/moxml/adapter/shared_examples/adapter_contract.rb'
|
|
129
|
+
- 'spec/moxml/declaration_preservation_spec.rb'
|
|
130
|
+
- 'spec/moxml/xpath/lexer_spec.rb'
|
|
131
|
+
- 'spec/moxml/xpath/parser_spec.rb'
|
|
132
|
+
- 'spec/performance/benchmark_spec.rb'
|
|
133
|
+
|
|
134
|
+
# Offense count: 15
|
|
135
|
+
# Configuration parameters: IgnoredMetadata.
|
|
136
|
+
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'
|
|
158
|
+
|
|
159
|
+
# Offense count: 217
|
|
160
|
+
# Configuration parameters: CountAsOne.
|
|
161
|
+
RSpec/ExampleLength:
|
|
162
|
+
Max: 85
|
|
79
163
|
|
|
80
164
|
# Offense count: 1
|
|
81
|
-
# This cop supports
|
|
82
|
-
|
|
83
|
-
# SupportedStyles: always, always_true, never
|
|
84
|
-
Style/FrozenStringLiteralComment:
|
|
165
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
166
|
+
RSpec/ExpectActual:
|
|
85
167
|
Exclude:
|
|
86
|
-
- '
|
|
168
|
+
- '**/spec/routing/**/*'
|
|
169
|
+
- 'spec/moxml/attribute_spec.rb'
|
|
170
|
+
|
|
171
|
+
# Offense count: 3
|
|
172
|
+
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
|
173
|
+
RSpec/IndexedLet:
|
|
174
|
+
Exclude:
|
|
175
|
+
- 'spec/integration/shared_examples/node_wrappers/namespace_behavior.rb'
|
|
176
|
+
|
|
177
|
+
# Offense count: 102
|
|
178
|
+
# Configuration parameters: AssignmentOnly.
|
|
179
|
+
RSpec/InstanceVariable:
|
|
180
|
+
Exclude:
|
|
181
|
+
- 'spec/moxml/sax_spec.rb'
|
|
182
|
+
|
|
183
|
+
# Offense count: 7
|
|
184
|
+
RSpec/LeakyConstantDeclaration:
|
|
185
|
+
Exclude:
|
|
186
|
+
- 'spec/moxml/declaration_preservation_spec.rb'
|
|
187
|
+
- 'spec/moxml/sax_spec.rb'
|
|
188
|
+
|
|
189
|
+
# Offense count: 2
|
|
190
|
+
# Configuration parameters: .
|
|
191
|
+
# SupportedStyles: have_received, receive
|
|
192
|
+
RSpec/MessageSpies:
|
|
193
|
+
EnforcedStyle: receive
|
|
194
|
+
|
|
195
|
+
# Offense count: 317
|
|
196
|
+
RSpec/MultipleExpectations:
|
|
197
|
+
Max: 10
|
|
198
|
+
|
|
199
|
+
# Offense count: 2
|
|
200
|
+
# Configuration parameters: AllowSubject.
|
|
201
|
+
RSpec/MultipleMemoizedHelpers:
|
|
202
|
+
Max: 7
|
|
203
|
+
|
|
204
|
+
# Offense count: 10
|
|
205
|
+
# Configuration parameters: AllowedGroups.
|
|
206
|
+
RSpec/NestedGroups:
|
|
207
|
+
Max: 4
|
|
208
|
+
|
|
209
|
+
# Offense count: 3
|
|
210
|
+
# Configuration parameters: AllowedPatterns.
|
|
211
|
+
# AllowedPatterns: ^expect_, ^assert_
|
|
212
|
+
RSpec/NoExpectationExample:
|
|
213
|
+
Exclude:
|
|
214
|
+
- 'spec/performance/xpath_benchmark_spec.rb'
|
|
215
|
+
|
|
216
|
+
# Offense count: 6
|
|
217
|
+
RSpec/PendingWithoutReason:
|
|
218
|
+
Exclude:
|
|
219
|
+
- 'spec/moxml/xpath/functions/position_functions_spec.rb'
|
|
220
|
+
- 'spec/moxml/xpath/functions/special_functions_spec.rb'
|
|
221
|
+
|
|
222
|
+
# Offense count: 2
|
|
223
|
+
RSpec/RepeatedExample:
|
|
224
|
+
Exclude:
|
|
225
|
+
- 'spec/integration/shared_examples/node_wrappers/node_set_behavior.rb'
|
|
226
|
+
|
|
227
|
+
# Offense count: 10
|
|
228
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
|
|
229
|
+
RSpec/SpecFilePathFormat:
|
|
230
|
+
Exclude:
|
|
231
|
+
- '**/spec/routing/**/*'
|
|
232
|
+
- 'spec/moxml/xpath/ast/node_spec.rb'
|
|
233
|
+
- 'spec/moxml/xpath/cache_spec.rb'
|
|
234
|
+
- 'spec/moxml/xpath/compiler_spec.rb'
|
|
235
|
+
- 'spec/moxml/xpath/context_spec.rb'
|
|
236
|
+
- 'spec/moxml/xpath/conversion_spec.rb'
|
|
237
|
+
- 'spec/moxml/xpath/lexer_spec.rb'
|
|
238
|
+
- 'spec/moxml/xpath/parser_spec.rb'
|
|
239
|
+
- 'spec/moxml/xpath/ruby/generator_spec.rb'
|
|
240
|
+
- 'spec/moxml/xpath/ruby/node_spec.rb'
|
|
241
|
+
- 'spec/moxml/xpath_spec.rb'
|
|
242
|
+
|
|
243
|
+
# Offense count: 1
|
|
244
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
|
245
|
+
RSpec/VerifiedDoubles:
|
|
246
|
+
Exclude:
|
|
247
|
+
- 'spec/moxml/xpath/conversion_spec.rb'
|
|
248
|
+
|
|
249
|
+
# Offense count: 1
|
|
250
|
+
Security/Eval:
|
|
251
|
+
Exclude:
|
|
252
|
+
- 'spec/moxml/xpath/ruby/generator_spec.rb'
|
|
253
|
+
|
|
254
|
+
# Offense count: 1
|
|
255
|
+
Style/DocumentDynamicEvalDefinition:
|
|
256
|
+
Exclude:
|
|
257
|
+
- 'spec/moxml/xpath/ruby/generator_spec.rb'
|
|
258
|
+
|
|
259
|
+
# Offense count: 1
|
|
260
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
261
|
+
Style/EvalWithLocation:
|
|
262
|
+
Exclude:
|
|
263
|
+
- 'spec/moxml/xpath/ruby/generator_spec.rb'
|
|
87
264
|
|
|
88
265
|
# Offense count: 2
|
|
89
266
|
# Configuration parameters: MinBranchesCount.
|
|
@@ -91,11 +268,15 @@ Style/HashLikeCase:
|
|
|
91
268
|
Exclude:
|
|
92
269
|
- 'lib/moxml/adapter/customized_rexml/formatter.rb'
|
|
93
270
|
|
|
94
|
-
# Offense count:
|
|
95
|
-
|
|
96
|
-
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
97
|
-
# AllowedMethods: present?, blank?, presence, try, try!
|
|
98
|
-
Style/SafeNavigation:
|
|
271
|
+
# Offense count: 1
|
|
272
|
+
Style/MissingRespondToMissing:
|
|
99
273
|
Exclude:
|
|
100
|
-
- 'lib/moxml/
|
|
101
|
-
|
|
274
|
+
- 'lib/moxml/xpath/ruby/node.rb'
|
|
275
|
+
|
|
276
|
+
# Offense count: 4
|
|
277
|
+
# Configuration parameters: AllowedMethods.
|
|
278
|
+
# AllowedMethods: respond_to_missing?
|
|
279
|
+
Style/OptionalBooleanParameter:
|
|
280
|
+
Exclude:
|
|
281
|
+
- 'lib/moxml/adapter/libxml.rb'
|
|
282
|
+
- 'lib/moxml/xpath/compiler.rb'
|
data/Gemfile
CHANGED
|
@@ -5,18 +5,23 @@ source "https://rubygems.org"
|
|
|
5
5
|
# Specify your gem's dependencies in moxml.gemspec
|
|
6
6
|
gemspec
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
gem "
|
|
10
|
-
gem "
|
|
8
|
+
# Provides iteration per second benchmarking for Ruby
|
|
9
|
+
gem "benchmark-ips"
|
|
10
|
+
gem "get_process_mem"
|
|
11
|
+
gem "libxml-ruby", "~> 5.0"
|
|
12
|
+
gem "nokogiri", "~> 1.18"
|
|
11
13
|
gem "oga", "~> 3.4"
|
|
14
|
+
gem "openssl"
|
|
12
15
|
gem "ox", "~> 2.14"
|
|
13
|
-
gem "rake"
|
|
16
|
+
gem "rake"
|
|
14
17
|
gem "rexml"
|
|
15
|
-
gem "rspec"
|
|
16
|
-
gem "rubocop"
|
|
17
|
-
gem "
|
|
18
|
-
|
|
19
|
-
gem "
|
|
18
|
+
gem "rspec"
|
|
19
|
+
gem "rubocop"
|
|
20
|
+
gem "rubocop-performance"
|
|
21
|
+
gem "rubocop-rake"
|
|
22
|
+
gem "rubocop-rspec"
|
|
23
|
+
gem "simplecov", require: false
|
|
24
|
+
gem "tempfile"
|
|
20
25
|
|
|
21
26
|
# Needed by get_process_mem on Windows
|
|
22
27
|
gem "sys-proctable" if Gem.win_platform?
|
data/LICENSE.md
CHANGED
|
@@ -5,10 +5,10 @@ This license file adheres to the formatting guidelines of
|
|
|
5
5
|
[readable-licenses](https://github.com/nevir/readable-licenses).
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
Ribose's BSD
|
|
8
|
+
Ribose's BSD 3-Clause License
|
|
9
9
|
-----------------------------
|
|
10
10
|
|
|
11
|
-
Copyright (c)
|
|
11
|
+
Copyright (c) 2025, [Ribose Inc](https://www.ribose.com).
|
|
12
12
|
All rights reserved.
|
|
13
13
|
|
|
14
14
|
Redistribution and use in source and binary forms, with or without modification,
|
|
@@ -21,6 +21,10 @@ are permitted provided that the following conditions are met:
|
|
|
21
21
|
this list of conditions and the following disclaimer in the documentation
|
|
22
22
|
and/or other materials provided with the distribution.
|
|
23
23
|
|
|
24
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
25
|
+
may be used to endorse or promote products derived from this software
|
|
26
|
+
without specific prior written permission.
|
|
27
|
+
|
|
24
28
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
25
29
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
26
30
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|