lutaml-model 0.8.202 → 0.8.204
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/.gitattributes +5 -0
- data/.github/workflows/dependent-tests.yml +59 -2
- data/.github/workflows/lml-conformance.yml +71 -0
- data/.gitignore +7 -0
- data/README.adoc +1 -0
- data/docs/_guides/lml-cross-language.adoc +128 -0
- data/docs/_references/lml-conformance.adoc +78 -0
- data/docs/_references/lml-contract.adoc +290 -0
- data/docs/_references/plan-schema-spec.adoc +45 -18
- data/lib/lutaml/key_value/transform.rb +140 -21
- data/lib/lutaml/model/attribute.rb +11 -6
- data/lib/lutaml/model/lml/artifact_verifier.rb +205 -0
- data/lib/lutaml/model/lml/bundle.rb +171 -0
- data/lib/lutaml/model/lml/document.rb +46 -10
- data/lib/lutaml/model/lml/document_validator.rb +840 -0
- data/lib/lutaml/model/lml/exporter/v1_projector.rb +102 -0
- data/lib/lutaml/model/lml/exporter/v2_projector.rb +401 -0
- data/lib/lutaml/model/lml/exporter.rb +223 -87
- data/lib/lutaml/model/lml/graph_exporter.rb +248 -0
- data/lib/lutaml/model/lml/importer.rb +180 -0
- data/lib/lutaml/model/lml/mapping_compiler.rb +401 -0
- data/lib/lutaml/model/lml/materialization.rb +257 -0
- data/lib/lutaml/model/lml/ordered_content.rb +577 -0
- data/lib/lutaml/model/lml/portable_json.rb +385 -0
- data/lib/lutaml/model/lml/rejected_error.rb +64 -15
- data/lib/lutaml/model/lml/round_trip.rb +86 -0
- data/lib/lutaml/model/lml/value_declarations.rb +84 -0
- data/lib/lutaml/model/lml.rb +61 -0
- data/lib/lutaml/model/schema/definitions/attribute.rb +4 -2
- data/lib/lutaml/model/schema/registry_generator.rb +1 -1
- data/lib/lutaml/model/schema/renderers/member_decls.rb +1 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder/members.rb +10 -0
- data/lib/lutaml/model/sequence.rb +7 -0
- data/lib/lutaml/model/serialize/deserialization_context.rb +21 -0
- data/lib/lutaml/model/serialize/initialization.rb +19 -9
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/xml/leptris/native_emission.rb +4 -0
- data/lib/lutaml/xml/leptris/plan_serializer.rb +14 -9
- data/schema/lml/document.schema.json +179 -0
- data/scripts/lml/export_choices.rb +57 -0
- data/scripts/lml/export_conformance.rb +23 -0
- data/scripts/lml/export_mml.rb +253 -0
- data/scripts/lml/export_preservation.rb +421 -0
- data/scripts/lml/verify_artifacts.rb +31 -0
- data/spec/address_person_spec.rb +8 -0
- data/spec/address_spec.rb +4 -0
- data/spec/fixtures/lml_artifacts/model.json +1 -0
- data/spec/fixtures/lml_artifacts/valid.json +1 -0
- data/spec/fixtures/lml_artifacts/valid.sha256 +1 -0
- data/spec/fixtures/lml_conformance/core/index.json +1 -0
- data/spec/fixtures/lml_conformance/core/manifest.json +1 -0
- data/spec/fixtures/lml_conformance/core/schema.json +1 -0
- data/spec/fixtures/lml_conformance/core/schema.yaml +79 -0
- data/spec/fixtures/lml_conformance/float_vectors.generator.rb +60 -0
- data/spec/fixtures/lml_conformance/float_vectors.json +21550 -0
- data/spec/fixtures/lml_conformance/preservation/index.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/manifest.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/schema.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/schema.yaml +319 -0
- data/spec/fixtures/lml_conformance/r2_refusals.generator.rb +153 -0
- data/spec/fixtures/lml_conformance/r2_refusals.json +1662 -0
- data/spec/fixtures/lml_conformance/ruby_portable_interop.generator.rb +40 -0
- data/spec/fixtures/lml_conformance/ruby_portable_interop.json +1 -0
- data/spec/fixtures/lml_contract/bundle.json +81 -0
- data/spec/fixtures/lml_contract/manifest.json +30 -0
- data/spec/fixtures/lml_contract/v1_unit.canonical.json +1 -0
- data/spec/fixtures/lml_contract/v1_unit.json +1 -0
- data/spec/fixtures/lml_contract/v2_node.canonical.json +1 -0
- data/spec/fixtures/lml_contract/v2_node.json +32 -0
- data/spec/fixtures/lml_mml/inventory.json +1 -0
- data/spec/fixtures/lml_mml/manifest.json +1 -0
- data/spec/fixtures/lml_mml/oracle.json +1 -0
- data/spec/fixtures/lml_mml/v3-mi-mixed.json +1 -0
- data/spec/fixtures/lml_mml/v3-mi-mixed.yaml +970 -0
- data/spec/fixtures/lml_mml/v4-mi-mixed.json +1 -0
- data/spec/fixtures/lml_mml/v4-mi-mixed.yaml +1516 -0
- data/spec/fixtures/lml_mml_materialization/replay.rb +37 -0
- data/spec/lutaml/key_value/group_instantiate_spec.rb +204 -1
- data/spec/lutaml/model/lml_any_attribute_spec.rb +91 -0
- data/spec/lutaml/model/lml_artifact_verifier_spec.rb +86 -0
- data/spec/lutaml/model/lml_builtin_types_spec.rb +49 -0
- data/spec/lutaml/model/lml_conformance_spec.rb +178 -0
- data/spec/lutaml/model/lml_document_spec.rb +279 -0
- data/spec/lutaml/model/lml_export_validation_spec.rb +96 -0
- data/spec/lutaml/model/lml_exporter_spec.rb +127 -5
- data/spec/lutaml/model/lml_graph_exporter_spec.rb +205 -0
- data/spec/lutaml/model/lml_importer_spec.rb +290 -0
- data/spec/lutaml/model/lml_input_hardening_spec.rb +156 -0
- data/spec/lutaml/model/lml_mapping_compiler_spec.rb +256 -0
- data/spec/lutaml/model/lml_materialization_spec.rb +138 -0
- data/spec/lutaml/model/lml_mml_materialization_spec.rb +54 -0
- data/spec/lutaml/model/lml_mml_pilot_spec.rb +150 -0
- data/spec/lutaml/model/lml_model_choices_spec.rb +88 -0
- data/spec/lutaml/model/lml_ordered_content_spec.rb +243 -0
- data/spec/lutaml/model/lml_portable_json_spec.rb +310 -0
- data/spec/lutaml/model/lml_preservation_spec.rb +211 -0
- data/spec/lutaml/model/lml_review_export_spec.rb +247 -0
- data/spec/lutaml/model/lml_review_import_spec.rb +390 -0
- data/spec/lutaml/model/lml_review_misc_spec.rb +152 -0
- data/spec/lutaml/model/lml_review_round4_spec.rb +200 -0
- data/spec/lutaml/model/lml_review_round5_spec.rb +194 -0
- data/spec/lutaml/model/lml_ruby_interop_fixture_spec.rb +37 -0
- data/spec/lutaml/model/lml_shared_corpus_spec.rb +132 -0
- data/spec/lutaml/model/lml_value_declarations_spec.rb +128 -0
- data/spec/lutaml/model/schema/class_loader_spec.rb +51 -0
- data/spec/lutaml/model/schema/xml_compiler_runtime_spec.rb +20 -0
- data/spec/lutaml/model/sequence_spec.rb +48 -0
- data/spec/lutaml/model/serialize/deserialization_context_spec.rb +68 -0
- data/spec/lutaml/xml/cdata_emission_spec.rb +68 -0
- data/spec/spec_helper.rb +4 -5
- data/spec/support/lml_any_attribute_fixtures.rb +26 -0
- data/spec/support/lml_conformance.rb +292 -0
- data/spec/support/lml_corpus.rb +75 -0
- data/spec/support/lml_export_fixtures.rb +190 -0
- data/spec/support/lml_graph_fixtures.rb +108 -0
- data/spec/support/lml_import_fixtures.rb +52 -0
- data/spec/support/lml_mapping_fixtures.rb +170 -0
- data/spec/support/lml_materialization_fixtures.rb +53 -0
- data/spec/support/lml_model_choices_fixtures.rb +150 -0
- data/spec/support/lml_order_fixtures.rb +151 -0
- metadata +93 -2
- data/lib/lutaml/model/schema/schema_builder/nokogiri.rb +0 -41
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.204
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -168,6 +168,7 @@ extensions: []
|
|
|
168
168
|
extra_rdoc_files: []
|
|
169
169
|
files:
|
|
170
170
|
- ".envrc"
|
|
171
|
+
- ".gitattributes"
|
|
171
172
|
- ".github/scripts/test_installed_gem.rb"
|
|
172
173
|
- ".github/workflows/dependent-repos-todo.json"
|
|
173
174
|
- ".github/workflows/dependent-repos-tools-informational.json"
|
|
@@ -176,6 +177,7 @@ files:
|
|
|
176
177
|
- ".github/workflows/dependent-tests.yml"
|
|
177
178
|
- ".github/workflows/docs.yml"
|
|
178
179
|
- ".github/workflows/downstream-performance.yml"
|
|
180
|
+
- ".github/workflows/lml-conformance.yml"
|
|
179
181
|
- ".github/workflows/performance.yml"
|
|
180
182
|
- ".github/workflows/rake.yml"
|
|
181
183
|
- ".github/workflows/release.yml"
|
|
@@ -231,6 +233,7 @@ files:
|
|
|
231
233
|
- docs/_guides/jsonld-serialization.adoc
|
|
232
234
|
- docs/_guides/keyvalue-serialization.adoc
|
|
233
235
|
- docs/_guides/liquid-templates.adoc
|
|
236
|
+
- docs/_guides/lml-cross-language.adoc
|
|
234
237
|
- docs/_guides/missing-values-handling.adoc
|
|
235
238
|
- docs/_guides/native-engines.adoc
|
|
236
239
|
- docs/_guides/ooxml-examples.adoc
|
|
@@ -287,6 +290,8 @@ files:
|
|
|
287
290
|
- docs/_references/format-independent-features.adoc
|
|
288
291
|
- docs/_references/index.adoc
|
|
289
292
|
- docs/_references/instance-serialization.adoc
|
|
293
|
+
- docs/_references/lml-conformance.adoc
|
|
294
|
+
- docs/_references/lml-contract.adoc
|
|
290
295
|
- docs/_references/lutaml-namespace-planning.md
|
|
291
296
|
- docs/_references/parent-root-context.adoc
|
|
292
297
|
- docs/_references/plan-schema-spec.adoc
|
|
@@ -634,10 +639,22 @@ files:
|
|
|
634
639
|
- lib/lutaml/model/liquid/indexed_access.rb
|
|
635
640
|
- lib/lutaml/model/liquid/mapping.rb
|
|
636
641
|
- lib/lutaml/model/lml.rb
|
|
642
|
+
- lib/lutaml/model/lml/artifact_verifier.rb
|
|
643
|
+
- lib/lutaml/model/lml/bundle.rb
|
|
637
644
|
- lib/lutaml/model/lml/document.rb
|
|
645
|
+
- lib/lutaml/model/lml/document_validator.rb
|
|
638
646
|
- lib/lutaml/model/lml/exporter.rb
|
|
647
|
+
- lib/lutaml/model/lml/exporter/v1_projector.rb
|
|
648
|
+
- lib/lutaml/model/lml/exporter/v2_projector.rb
|
|
649
|
+
- lib/lutaml/model/lml/graph_exporter.rb
|
|
650
|
+
- lib/lutaml/model/lml/importer.rb
|
|
651
|
+
- lib/lutaml/model/lml/mapping_compiler.rb
|
|
652
|
+
- lib/lutaml/model/lml/materialization.rb
|
|
653
|
+
- lib/lutaml/model/lml/ordered_content.rb
|
|
654
|
+
- lib/lutaml/model/lml/portable_json.rb
|
|
639
655
|
- lib/lutaml/model/lml/rejected_error.rb
|
|
640
656
|
- lib/lutaml/model/lml/round_trip.rb
|
|
657
|
+
- lib/lutaml/model/lml/value_declarations.rb
|
|
641
658
|
- lib/lutaml/model/mapping/listener.rb
|
|
642
659
|
- lib/lutaml/model/mapping/mapping.rb
|
|
643
660
|
- lib/lutaml/model/mapping/mapping_rule.rb
|
|
@@ -711,7 +728,6 @@ files:
|
|
|
711
728
|
- lib/lutaml/model/schema/rng_compiler/member_collector.rb
|
|
712
729
|
- lib/lutaml/model/schema/rng_compiler/rng_helpers.rb
|
|
713
730
|
- lib/lutaml/model/schema/rng_compiler/value_type_resolver.rb
|
|
714
|
-
- lib/lutaml/model/schema/schema_builder/nokogiri.rb
|
|
715
731
|
- lib/lutaml/model/schema/shared_methods.rb
|
|
716
732
|
- lib/lutaml/model/schema/templates.rb
|
|
717
733
|
- lib/lutaml/model/schema/templates/model.erb
|
|
@@ -1114,8 +1130,14 @@ files:
|
|
|
1114
1130
|
- lib/tasks/xml_compiler_benchmark.rb
|
|
1115
1131
|
- lutaml-model.gemspec
|
|
1116
1132
|
- reference-docs/XML Entity Definitions for Characters (3rd Edition).html
|
|
1133
|
+
- schema/lml/document.schema.json
|
|
1117
1134
|
- scripts-xmi-profile/profile_xmi.rb
|
|
1118
1135
|
- scripts-xmi-profile/profile_xmi_simple.rb
|
|
1136
|
+
- scripts/lml/export_choices.rb
|
|
1137
|
+
- scripts/lml/export_conformance.rb
|
|
1138
|
+
- scripts/lml/export_mml.rb
|
|
1139
|
+
- scripts/lml/export_preservation.rb
|
|
1140
|
+
- scripts/lml/verify_artifacts.rb
|
|
1119
1141
|
- sig/lutaml/model.rbs
|
|
1120
1142
|
- spec/address_person_spec.rb
|
|
1121
1143
|
- spec/address_spec.rb
|
|
@@ -1129,6 +1151,37 @@ files:
|
|
|
1129
1151
|
- spec/fixtures/geolexica_v2_sample2.yaml
|
|
1130
1152
|
- spec/fixtures/liquid_templates/_ceramic.liquid
|
|
1131
1153
|
- spec/fixtures/liquid_templates/_ceramics_in_one.liquid
|
|
1154
|
+
- spec/fixtures/lml_artifacts/model.json
|
|
1155
|
+
- spec/fixtures/lml_artifacts/valid.json
|
|
1156
|
+
- spec/fixtures/lml_artifacts/valid.sha256
|
|
1157
|
+
- spec/fixtures/lml_conformance/core/index.json
|
|
1158
|
+
- spec/fixtures/lml_conformance/core/manifest.json
|
|
1159
|
+
- spec/fixtures/lml_conformance/core/schema.json
|
|
1160
|
+
- spec/fixtures/lml_conformance/core/schema.yaml
|
|
1161
|
+
- spec/fixtures/lml_conformance/float_vectors.generator.rb
|
|
1162
|
+
- spec/fixtures/lml_conformance/float_vectors.json
|
|
1163
|
+
- spec/fixtures/lml_conformance/preservation/index.json
|
|
1164
|
+
- spec/fixtures/lml_conformance/preservation/manifest.json
|
|
1165
|
+
- spec/fixtures/lml_conformance/preservation/schema.json
|
|
1166
|
+
- spec/fixtures/lml_conformance/preservation/schema.yaml
|
|
1167
|
+
- spec/fixtures/lml_conformance/r2_refusals.generator.rb
|
|
1168
|
+
- spec/fixtures/lml_conformance/r2_refusals.json
|
|
1169
|
+
- spec/fixtures/lml_conformance/ruby_portable_interop.generator.rb
|
|
1170
|
+
- spec/fixtures/lml_conformance/ruby_portable_interop.json
|
|
1171
|
+
- spec/fixtures/lml_contract/bundle.json
|
|
1172
|
+
- spec/fixtures/lml_contract/manifest.json
|
|
1173
|
+
- spec/fixtures/lml_contract/v1_unit.canonical.json
|
|
1174
|
+
- spec/fixtures/lml_contract/v1_unit.json
|
|
1175
|
+
- spec/fixtures/lml_contract/v2_node.canonical.json
|
|
1176
|
+
- spec/fixtures/lml_contract/v2_node.json
|
|
1177
|
+
- spec/fixtures/lml_mml/inventory.json
|
|
1178
|
+
- spec/fixtures/lml_mml/manifest.json
|
|
1179
|
+
- spec/fixtures/lml_mml/oracle.json
|
|
1180
|
+
- spec/fixtures/lml_mml/v3-mi-mixed.json
|
|
1181
|
+
- spec/fixtures/lml_mml/v3-mi-mixed.yaml
|
|
1182
|
+
- spec/fixtures/lml_mml/v4-mi-mixed.json
|
|
1183
|
+
- spec/fixtures/lml_mml/v4-mi-mixed.yaml
|
|
1184
|
+
- spec/fixtures/lml_mml_materialization/replay.rb
|
|
1132
1185
|
- spec/fixtures/metanorma_iec_title_consolidation.xml
|
|
1133
1186
|
- spec/fixtures/person.rb
|
|
1134
1187
|
- spec/fixtures/sample_model.rb
|
|
@@ -2095,7 +2148,32 @@ files:
|
|
|
2095
2148
|
- spec/lutaml/model/liquefiable_spec.rb
|
|
2096
2149
|
- spec/lutaml/model/liquid/indexed_access_spec.rb
|
|
2097
2150
|
- spec/lutaml/model/liquid_compatibility_spec.rb
|
|
2151
|
+
- spec/lutaml/model/lml_any_attribute_spec.rb
|
|
2152
|
+
- spec/lutaml/model/lml_artifact_verifier_spec.rb
|
|
2153
|
+
- spec/lutaml/model/lml_builtin_types_spec.rb
|
|
2154
|
+
- spec/lutaml/model/lml_conformance_spec.rb
|
|
2155
|
+
- spec/lutaml/model/lml_document_spec.rb
|
|
2156
|
+
- spec/lutaml/model/lml_export_validation_spec.rb
|
|
2098
2157
|
- spec/lutaml/model/lml_exporter_spec.rb
|
|
2158
|
+
- spec/lutaml/model/lml_graph_exporter_spec.rb
|
|
2159
|
+
- spec/lutaml/model/lml_importer_spec.rb
|
|
2160
|
+
- spec/lutaml/model/lml_input_hardening_spec.rb
|
|
2161
|
+
- spec/lutaml/model/lml_mapping_compiler_spec.rb
|
|
2162
|
+
- spec/lutaml/model/lml_materialization_spec.rb
|
|
2163
|
+
- spec/lutaml/model/lml_mml_materialization_spec.rb
|
|
2164
|
+
- spec/lutaml/model/lml_mml_pilot_spec.rb
|
|
2165
|
+
- spec/lutaml/model/lml_model_choices_spec.rb
|
|
2166
|
+
- spec/lutaml/model/lml_ordered_content_spec.rb
|
|
2167
|
+
- spec/lutaml/model/lml_portable_json_spec.rb
|
|
2168
|
+
- spec/lutaml/model/lml_preservation_spec.rb
|
|
2169
|
+
- spec/lutaml/model/lml_review_export_spec.rb
|
|
2170
|
+
- spec/lutaml/model/lml_review_import_spec.rb
|
|
2171
|
+
- spec/lutaml/model/lml_review_misc_spec.rb
|
|
2172
|
+
- spec/lutaml/model/lml_review_round4_spec.rb
|
|
2173
|
+
- spec/lutaml/model/lml_review_round5_spec.rb
|
|
2174
|
+
- spec/lutaml/model/lml_ruby_interop_fixture_spec.rb
|
|
2175
|
+
- spec/lutaml/model/lml_shared_corpus_spec.rb
|
|
2176
|
+
- spec/lutaml/model/lml_value_declarations_spec.rb
|
|
2099
2177
|
- spec/lutaml/model/logger_spec.rb
|
|
2100
2178
|
- spec/lutaml/model/map_all_attributes_spec.rb
|
|
2101
2179
|
- spec/lutaml/model/map_all_spec.rb
|
|
@@ -2131,6 +2209,7 @@ files:
|
|
|
2131
2209
|
- spec/lutaml/model/root_mappings_spec.rb
|
|
2132
2210
|
- spec/lutaml/model/rule_value_extractor_spec.rb
|
|
2133
2211
|
- spec/lutaml/model/runtime_compatibility_spec.rb
|
|
2212
|
+
- spec/lutaml/model/schema/class_loader_spec.rb
|
|
2134
2213
|
- spec/lutaml/model/schema/generate_many_spec.rb
|
|
2135
2214
|
- spec/lutaml/model/schema/generation_regressions_spec.rb
|
|
2136
2215
|
- spec/lutaml/model/schema/generator/definitions_collection_spec.rb
|
|
@@ -2153,6 +2232,7 @@ files:
|
|
|
2153
2232
|
- spec/lutaml/model/serializable_validation_spec.rb
|
|
2154
2233
|
- spec/lutaml/model/serialization_profiles_spec.rb
|
|
2155
2234
|
- spec/lutaml/model/serialize/builder_spec.rb
|
|
2235
|
+
- spec/lutaml/model/serialize/deserialization_context_spec.rb
|
|
2156
2236
|
- spec/lutaml/model/serialize_perf_guard_spec.rb
|
|
2157
2237
|
- spec/lutaml/model/services/transformer_spec.rb
|
|
2158
2238
|
- spec/lutaml/model/simple_model_spec.rb
|
|
@@ -2271,6 +2351,7 @@ files:
|
|
|
2271
2351
|
- spec/lutaml/xml/attribute_element_namespace_disjoint_spec.rb
|
|
2272
2352
|
- spec/lutaml/xml/attribute_namespace_disjointness_spec.rb
|
|
2273
2353
|
- spec/lutaml/xml/builder/builder_spec.rb
|
|
2354
|
+
- spec/lutaml/xml/cdata_emission_spec.rb
|
|
2274
2355
|
- spec/lutaml/xml/clear_parse_state_spec.rb
|
|
2275
2356
|
- spec/lutaml/xml/compiled_rule_namespace_spec.rb
|
|
2276
2357
|
- spec/lutaml/xml/conformance/xml_namespaces_spec.rb
|
|
@@ -2437,6 +2518,16 @@ files:
|
|
|
2437
2518
|
- spec/person_spec.rb
|
|
2438
2519
|
- spec/sample_model_spec.rb
|
|
2439
2520
|
- spec/spec_helper.rb
|
|
2521
|
+
- spec/support/lml_any_attribute_fixtures.rb
|
|
2522
|
+
- spec/support/lml_conformance.rb
|
|
2523
|
+
- spec/support/lml_corpus.rb
|
|
2524
|
+
- spec/support/lml_export_fixtures.rb
|
|
2525
|
+
- spec/support/lml_graph_fixtures.rb
|
|
2526
|
+
- spec/support/lml_import_fixtures.rb
|
|
2527
|
+
- spec/support/lml_mapping_fixtures.rb
|
|
2528
|
+
- spec/support/lml_materialization_fixtures.rb
|
|
2529
|
+
- spec/support/lml_model_choices_fixtures.rb
|
|
2530
|
+
- spec/support/lml_order_fixtures.rb
|
|
2440
2531
|
- spec/support/test_adapter_config.rb
|
|
2441
2532
|
- spec/support/test_namespaces.rb
|
|
2442
2533
|
- spec/support/trace_helper.rb
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "nokogiri"
|
|
4
|
-
|
|
5
|
-
module Lutaml
|
|
6
|
-
module Model
|
|
7
|
-
module Schema
|
|
8
|
-
class SchemaBuilder
|
|
9
|
-
# Nokogiri adapter for XSD schema generation
|
|
10
|
-
# Wraps Nokogiri::XML::Builder to provide schema building capabilities
|
|
11
|
-
class Nokogiri
|
|
12
|
-
attr_reader :builder
|
|
13
|
-
|
|
14
|
-
def initialize(options = {}, &block)
|
|
15
|
-
encoding = options[:encoding] || "UTF-8"
|
|
16
|
-
@builder = if block
|
|
17
|
-
::Nokogiri::XML::Builder.new(encoding: encoding,
|
|
18
|
-
&block)
|
|
19
|
-
else
|
|
20
|
-
::Nokogiri::XML::Builder.new(encoding: encoding)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Generate the XSD schema XML string
|
|
25
|
-
# @param options [Hash] formatting options
|
|
26
|
-
# @option options [Boolean] :pretty Pretty print with indentation
|
|
27
|
-
# @option options [Integer] :indent Number of spaces for indentation (default: 2)
|
|
28
|
-
# @return [String] XSD XML string
|
|
29
|
-
def to_xml(options = {})
|
|
30
|
-
if options[:pretty]
|
|
31
|
-
indent = options[:indent] || 2
|
|
32
|
-
builder.to_xml(indent: indent)
|
|
33
|
-
else
|
|
34
|
-
builder.to_xml
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|