moxml 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +15 -0
- data/.github/workflows/release.yml +23 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +65 -0
- data/.ruby-version +1 -0
- data/Gemfile +10 -3
- data/README.adoc +400 -594
- data/lib/moxml/adapter/base.rb +102 -0
- data/lib/moxml/adapter/customized_oga/xml_declaration.rb +18 -0
- data/lib/moxml/adapter/customized_oga/xml_generator.rb +104 -0
- data/lib/moxml/adapter/nokogiri.rb +314 -0
- data/lib/moxml/adapter/oga.rb +309 -0
- data/lib/moxml/adapter/ox.rb +325 -0
- data/lib/moxml/adapter.rb +26 -170
- data/lib/moxml/attribute.rb +47 -14
- data/lib/moxml/builder.rb +64 -0
- data/lib/moxml/cdata.rb +4 -26
- data/lib/moxml/comment.rb +6 -22
- data/lib/moxml/config.rb +39 -15
- data/lib/moxml/context.rb +29 -0
- data/lib/moxml/declaration.rb +16 -26
- data/lib/moxml/doctype.rb +9 -0
- data/lib/moxml/document.rb +51 -63
- data/lib/moxml/document_builder.rb +87 -0
- data/lib/moxml/element.rb +61 -99
- data/lib/moxml/error.rb +20 -0
- data/lib/moxml/namespace.rb +12 -37
- data/lib/moxml/node.rb +78 -58
- data/lib/moxml/node_set.rb +19 -222
- data/lib/moxml/processing_instruction.rb +6 -25
- data/lib/moxml/text.rb +4 -26
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml/xml_utils/encoder.rb +55 -0
- data/lib/moxml/xml_utils.rb +80 -0
- data/lib/moxml.rb +33 -33
- data/moxml.gemspec +1 -1
- data/spec/moxml/adapter/nokogiri_spec.rb +14 -0
- data/spec/moxml/adapter/oga_spec.rb +14 -0
- data/spec/moxml/adapter/ox_spec.rb +49 -0
- data/spec/moxml/all_with_adapters_spec.rb +46 -0
- data/spec/moxml/config_spec.rb +55 -0
- data/spec/moxml/error_spec.rb +71 -0
- data/spec/moxml/examples/adapter_spec.rb +27 -0
- data/spec/moxml_spec.rb +50 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support/shared_examples/attribute.rb +165 -0
- data/spec/support/shared_examples/builder.rb +25 -0
- data/spec/support/shared_examples/cdata.rb +70 -0
- data/spec/support/shared_examples/comment.rb +65 -0
- data/spec/support/shared_examples/context.rb +35 -0
- data/spec/support/shared_examples/declaration.rb +93 -0
- data/spec/support/shared_examples/doctype.rb +25 -0
- data/spec/support/shared_examples/document.rb +110 -0
- data/spec/support/shared_examples/document_builder.rb +43 -0
- data/spec/support/shared_examples/edge_cases.rb +185 -0
- data/spec/support/shared_examples/element.rb +110 -0
- data/spec/support/shared_examples/examples/attribute.rb +42 -0
- data/spec/support/shared_examples/examples/basic_usage.rb +67 -0
- data/spec/support/shared_examples/examples/memory.rb +54 -0
- data/spec/support/shared_examples/examples/namespace.rb +65 -0
- data/spec/support/shared_examples/examples/readme_examples.rb +100 -0
- data/spec/support/shared_examples/examples/thread_safety.rb +43 -0
- data/spec/support/shared_examples/examples/xpath.rb +39 -0
- data/spec/support/shared_examples/integration.rb +135 -0
- data/spec/support/shared_examples/namespace.rb +96 -0
- data/spec/support/shared_examples/node.rb +110 -0
- data/spec/support/shared_examples/node_set.rb +90 -0
- data/spec/support/shared_examples/processing_instruction.rb +88 -0
- data/spec/support/shared_examples/text.rb +66 -0
- data/spec/support/shared_examples/xml_adapter.rb +191 -0
- data/spec/support/xml_matchers.rb +27 -0
- metadata +55 -6
- data/.github/workflows/main.yml +0 -27
- data/lib/moxml/error_handler.rb +0 -77
- data/lib/moxml/errors.rb +0 -169
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd59e7a59b29416c792cd5d84cedceaede12d661e96c1da3b78af9711bcdb95
|
4
|
+
data.tar.gz: bb90166adcfa1e8c5440b6f991c842358df348e62a3a04e11a228ff7c96590c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e23367b7e18bc71b64527f1e8e7481279132366d169551b665e11d474c473e779bb6424158f64a6171f0e6122d12268cd573c2d12abaa20a80666f538224d1b
|
7
|
+
data.tar.gz: 3760403535f405b1153aeb02a7b9ff0c1896b961eed403a017ab32522202b7aa9fe1adb1d455c59ae903e5903ab6d2ddea57ec64cb4570e538420efc63d9014a
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: rake
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master, main ]
|
8
|
+
tags: [ v* ]
|
9
|
+
pull_request:
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
rake:
|
13
|
+
uses: metanorma/ci/.github/workflows/generic-rake.yml@main
|
14
|
+
secrets:
|
15
|
+
pat_token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_dispatch:
|
7
|
+
inputs:
|
8
|
+
next_version:
|
9
|
+
description: |
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
11
|
+
required: true
|
12
|
+
default: 'skip'
|
13
|
+
repository_dispatch:
|
14
|
+
types: [ do-release ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
release:
|
18
|
+
uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
|
19
|
+
with:
|
20
|
+
next_version: ${{ github.event.inputs.next_version }}
|
21
|
+
secrets:
|
22
|
+
rubygems-api-key: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }}
|
23
|
+
pat_token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-01-13 02:38:07 UTC using RuboCop version 1.70.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Lint/IneffectiveAccessModifier:
|
11
|
+
Exclude:
|
12
|
+
- 'lib/moxml/node.rb'
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
# Configuration parameters: MaximumRangeSize.
|
16
|
+
Lint/MissingCopEnableDirective:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/moxml/adapter/customized_oga/xml_generator.rb'
|
19
|
+
|
20
|
+
# Offense count: 1
|
21
|
+
# Configuration parameters: AllowedParentClasses.
|
22
|
+
Lint/MissingSuper:
|
23
|
+
Exclude:
|
24
|
+
- 'lib/moxml/adapter/customized_oga/xml_declaration.rb'
|
25
|
+
|
26
|
+
# Offense count: 5
|
27
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
28
|
+
Metrics/AbcSize:
|
29
|
+
Max: 30
|
30
|
+
|
31
|
+
# Offense count: 46
|
32
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
33
|
+
# AllowedMethods: refine
|
34
|
+
Metrics/BlockLength:
|
35
|
+
Max: 152
|
36
|
+
|
37
|
+
# Offense count: 3
|
38
|
+
# Configuration parameters: CountComments, CountAsOne.
|
39
|
+
Metrics/ClassLength:
|
40
|
+
Max: 246
|
41
|
+
|
42
|
+
# Offense count: 3
|
43
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
44
|
+
Metrics/CyclomaticComplexity:
|
45
|
+
Max: 10
|
46
|
+
|
47
|
+
# Offense count: 9
|
48
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
49
|
+
Metrics/MethodLength:
|
50
|
+
Max: 20
|
51
|
+
|
52
|
+
# Offense count: 4
|
53
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
54
|
+
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
55
|
+
Naming/MethodParameterName:
|
56
|
+
Exclude:
|
57
|
+
- 'lib/moxml/adapter/customized_oga/xml_generator.rb'
|
58
|
+
- 'lib/moxml/adapter/nokogiri.rb'
|
59
|
+
- 'lib/moxml/adapter/ox.rb'
|
60
|
+
- 'lib/moxml/attribute.rb'
|
61
|
+
|
62
|
+
# Offense count: 27
|
63
|
+
# Configuration parameters: AllowedConstants.
|
64
|
+
Style/Documentation:
|
65
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.7@moxml
|
data/Gemfile
CHANGED
@@ -5,8 +5,15 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in moxml.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem "
|
9
|
-
|
8
|
+
gem "byebug"
|
9
|
+
gem "get_process_mem", "~> 1.0"
|
10
|
+
gem "nokogiri", "~> 1.15"
|
11
|
+
gem "oga", "~> 3.4"
|
12
|
+
gem "ox", "~> 2.14"
|
13
|
+
gem "rake", "~> 13"
|
10
14
|
gem "rspec", "~> 3.0"
|
11
|
-
|
12
15
|
gem "rubocop", "~> 1.21"
|
16
|
+
gem "tempfile", "~> 0.3"
|
17
|
+
|
18
|
+
# Needed by get_process_mem on Windows
|
19
|
+
gem "sys-proctable" if Gem.win_platform?
|