ea 0.6.149 → 0.6.151
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/LICENSE.md +33 -0
- data/README.adoc +13 -5
- data/lib/ea/cli/command/base.rb +3 -3
- data/lib/ea/qea/database.rb +7 -0
- data/lib/ea/qea/factory/association_builder.rb +1 -1
- data/lib/ea/qea/factory/association_transformer.rb +1 -1
- data/lib/ea/qea/factory/attribute_tag_transformer.rb +2 -2
- data/lib/ea/qea/factory/attribute_transformer.rb +4 -9
- data/lib/ea/qea/factory/base_transformer.rb +22 -14
- data/lib/ea/qea/factory/class_transformer.rb +1 -1
- data/lib/ea/qea/factory/data_type_transformer.rb +1 -1
- data/lib/ea/qea/factory/diagram_transformer.rb +1 -1
- data/lib/ea/qea/factory/enum_transformer.rb +2 -2
- data/lib/ea/qea/factory/generalization_transformer.rb +1 -1
- data/lib/ea/qea/factory/instance_transformer.rb +1 -1
- data/lib/ea/qea/factory/object_property_transformer.rb +2 -2
- data/lib/ea/qea/factory/operation_transformer.rb +1 -1
- data/lib/ea/qea/infrastructure/database_connection.rb +71 -1
- data/lib/ea/qea/infrastructure/table_reader.rb +33 -14
- data/lib/ea/qea/services/database_loader.rb +22 -6
- data/lib/ea/query/builder.rb +1 -1
- data/lib/ea/rtf.rb +98 -0
- data/lib/ea/sources/qea/annotation_builder.rb +1 -1
- data/lib/ea/svg/ea_emitter/text_renderer.rb +28 -10
- data/lib/ea/version.rb +1 -1
- data/lib/ea/xmi/liquid_drops/klass_drop.rb +5 -0
- data/lib/ea/xmi/lookup_service.rb +40 -3
- data/lib/ea/xmi/parser.rb +3 -2
- data/lib/ea.rb +1 -0
- metadata +6 -396
- data/CLAUDE.md +0 -153
- data/Rakefile +0 -23
- data/TODO.complete/01-t-xref-parsing.md +0 -91
- data/TODO.complete/02-per-label-geometry.md +0 -50
- data/TODO.complete/03-object-properties-constraints.md +0 -57
- data/TODO.complete/04-operation-params.md +0 -37
- data/TODO.complete/05-pdata-flag-matrix.md +0 -52
- data/TODO.complete/06-emf-image-rendering.md +0 -34
- data/TODO.complete/07-auxiliary-tables.md +0 -47
- data/TODO.complete/10-mdg-stereotype-registry.md +0 -40
- data/TODO.complete/11-gml-xsd-generation.md +0 -42
- data/TODO.complete/13-shapescript-interpreter.md +0 -17
- data/TODO.complete/20-cli-diff.md +0 -46
- data/TODO.complete/21-cli-render.md +0 -26
- data/TODO.complete/22-cli-export.md +0 -29
- data/TODO.complete/23-cli-mdg.md +0 -23
- data/TODO.complete/30-headerlines-ocp-refactor.md +0 -72
- data/TODO.complete/31-public-send-cleanup.md +0 -61
- data/TODO.complete/32-spec-coverage.md +0 -33
- data/TODO.complete/33-blocked-parity-gaps.md +0 -41
- data/TODO.complete/36-stereotype-icon-wiring.md +0 -32
- data/TODO.complete/37-cli-lint.md +0 -32
- data/TODO.complete/38-cli-query.md +0 -26
- data/TODO.complete/39-cli-info.md +0 -23
- data/TODO.complete/40-ocl-evaluator.md +0 -31
- data/TODO.complete/41-round-trip-spec.md +0 -18
- data/TODO.complete/42-html-diff-report.md +0 -18
- data/TODO.complete/43-json-schema-export.md +0 -20
- data/TODO.complete/44-remaining-qea-tables.md +0 -40
- data/TODO.complete/45-shapescript-extensions.md +0 -25
- data/TODO.complete/46-xsd-consolidation.md +0 -20
- data/TODO.complete/47-headerlines-legacy-removal.md +0 -20
- data/TODO.complete/51-remove-respond-to.md +0 -52
- data/TODO.complete/52-xsd-decouple-fixtures.md +0 -23
- data/TODO.complete/53-xmi-public-send-cleanup.md +0 -26
- data/TODO.complete/54-wire-stereotype-icon-renderer.md +0 -20
- data/TODO.complete/55-wire-shapescript.md +0 -20
- data/TODO.complete/56-wire-emf-renderer.md +0 -27
- data/TODO.complete/57-wire-ocl-evaluator.md +0 -23
- data/TODO.complete/58-diff-modifications.md +0 -21
- data/TODO.complete/59-delete-toy-xmi-export.md +0 -30
- data/TODO.complete/60-curate-json-export.md +0 -20
- data/TODO.complete/61-plantuml-relationships.md +0 -22
- data/TODO.complete/62-changelog.md +0 -17
- data/TODO.complete/63-dependabot-fix.md +0 -18
- data/TODO.complete/64-qeatoxmi-connectors.md +0 -15
- data/TODO.complete/65-qeatoxmi-diagrams.md +0 -15
- data/TODO.complete/66-qeatoxmi-style-tags-docs.md +0 -35
- data/TODO.complete/67-ocl-collection-ops.md +0 -20
- data/TODO.complete/68-ocl-comparison-ops.md +0 -24
- data/TODO.complete/69-spec-new-models.md +0 -20
- data/TODO.complete/70-specs-for-all-models.md +0 -21
- data/TODO.complete/71-autoload-audit.md +0 -26
- data/TODO.complete/72-extension-serializer-ocp-naming.md +0 -26
- data/TODO.complete/73-ocl-validator-latent-bugs.md +0 -50
- data/TODO.complete/74-visibility-symbol-dry.md +0 -39
- data/TODO.complete/75-database-table-collection-registry.md +0 -32
- data/TODO.complete/76-stale-todo-cleanup.md +0 -52
- data/TODO.complete/77-eliminate-banned-patterns-from-specs.md +0 -55
- data/TODO.complete/78-mdg-stereotype-emission.md +0 -66
- data/TODO.complete/79-equivalence-fixes.md +0 -57
- data/TODO.complete/80-performance-extension-serializer-indexes.md +0 -43
- data/TODO.complete/81-dry-scope-guid-extraction.md +0 -33
- data/TODO.complete/82-public-send-audit-conclusion.md +0 -25
- data/TODO.complete/83-dry-shared-xml-escape-guid-format.md +0 -52
- data/TODO.complete/84-ocp-markers-shape-registry.md +0 -54
- data/TODO.complete/85-frozen-literal-rubocop-normalize-type-spec.md +0 -38
- data/TODO.complete/86-frozen-sweep-lint-query-specs.md +0 -55
- data/TODO.complete/STATUS.md +0 -106
- data/TODO.diagrams/01-svg-measurement-harness.md +0 -31
- data/TODO.diagrams/01-xmi-extension-elements-parsing.md +0 -67
- data/TODO.diagrams/02-diagram-element-rich-model.md +0 -61
- data/TODO.diagrams/02-polygon-over-rendering.md +0 -29
- data/TODO.diagrams/03-ea-style-svg-emitter.md +0 -70
- data/TODO.diagrams/03-text-over-rendering.md +0 -30
- data/TODO.diagrams/04-connector-routing-from-soid-eoid.md +0 -55
- data/TODO.diagrams/04-rect-under-rendering.md +0 -33
- data/TODO.diagrams/05-canvas-dimension-parity.md +0 -51
- data/TODO.diagrams/05-marker-rendering-per-relationship-type.md +0 -49
- data/TODO.diagrams/06-connector-labels.md +0 -49
- data/TODO.diagrams/06-group-layering-parity.md +0 -39
- data/TODO.diagrams/07-canvas-size-and-viewbox.md +0 -39
- data/TODO.diagrams/07-text-content-fidelity.md +0 -65
- data/TODO.diagrams/08-qea-direct-pipeline.md +0 -46
- data/TODO.diagrams/08-visual-regression-harness.md +0 -34
- data/TODO.diagrams/09-cli-render-all-diagrams.md +0 -25
- data/TODO.diagrams/10-stereotype-color-config.md +0 -29
- data/TODO.diagrams/11-elkrb-auto-layout-integration.md +0 -53
- data/TODO.diagrams/12-connector-labels.md +0 -40
- data/TODO.diagrams/12-per-entity-svg-layer-ordering.md +0 -24
- data/TODO.diagrams/13-marker-polygon-vs-path-dispatch.md +0 -20
- data/TODO.diagrams/13-per-text-type-font-sizes.md +0 -33
- data/TODO.diagrams/14-center-header-text.md +0 -33
- data/TODO.diagrams/14-filter-diagram-frame-elements.md +0 -18
- data/TODO.diagrams/15-deep-dead-code-audit.md +0 -47
- data/TODO.diagrams/15-per-element-font-from-style.md +0 -24
- data/TODO.diagrams/16-canvas-marker-extent.md +0 -30
- data/TODO.diagrams/16-document-remaining-parity-gaps.md +0 -91
- data/TODO.diagrams/17-italic-abstract-classes.md +0 -28
- data/TODO.diagrams/17-remaining-parity-gaps.md +0 -90
- data/TODO.diagrams/18-canvas-from-image-bounds.md +0 -20
- data/TODO.diagrams/18-property-lookup-index.md +0 -42
- data/TODO.diagrams/19-connector-sx-sy-routing.md +0 -27
- data/TODO.diagrams/19-replace-respond-to-with-is-a.md +0 -31
- data/TODO.diagrams/20-split-labels-emitter.md +0 -56
- data/TODO.diagrams/20-visibility-glyph-font-encoding.md +0 -27
- data/TODO.diagrams/21-aggregation-navigability-arrow.md +0 -21
- data/TODO.diagrams/21-auto-generated-legend-block.md +0 -65
- data/TODO.diagrams/22-ghost-element-discriminator.md +0 -57
- data/TODO.diagrams/22-style-based-path-grouping.md +0 -28
- data/TODO.diagrams/23-marker-polygon-deduplication.md +0 -47
- data/TODO.diagrams/23-multiplicity-label-positioning.md +0 -29
- data/TODO.diagrams/24-marker-anchor-structural.md +0 -35
- data/TODO.diagrams/24-track-marker-anchors-structurally.md +0 -66
- data/TODO.diagrams/24-truncate-properties-to-fit-box.md +0 -24
- data/TODO.diagrams/26-phantom-general-parent-rendering.md +0 -59
- data/TODO.diagrams/27-path-grouping-mode-detection.md +0 -43
- data/TODO.diagrams/28-architecture-cleanup-batch.md +0 -47
- data/TODO.diagrams/30-decompose-elements-groups-for.md +0 -52
- data/TODO.diagrams/32-examples-coverage-batch.md +0 -78
- data/TODO.diagrams/36-instance-specification-model.md +0 -42
- data/TODO.diagrams/37-element-icon-decorations.md +0 -41
- data/TODO.diagrams/38-html-note-and-receptions.md +0 -32
- data/TODO.diagrams/39-property-stereotype-discriminator.md +0 -40
- data/TODO.diagrams/40-standalone-1-discriminator.md +0 -38
- data/TODO.diagrams/41-xmi-to-svg-pipeline.md +0 -113
- data/TODO.diagrams/42-close-all-parity-deltas.md +0 -69
- data/TODO.diagrams/43-marker-deduplication-strategy.md +0 -54
- data/TODO.diagrams/44-element-icon-decorations.md +0 -34
- data/TODO.diagrams/45-phantom-parent-class-boxes.md +0 -40
- data/TODO.diagrams/46-user-drawn-legend-swatches.md +0 -44
- data/TODO.diagrams/47-attribute-line-fidelity.md +0 -72
- data/TODO.diagrams/48-spec-coverage-critical-emitter-components.md +0 -45
- data/TODO.diagrams/49-spec-coverage-orchestrators.md +0 -25
- data/TODO.diagrams/50-examples-parity.md +0 -85
- data/TODO.diagrams/51-property-oy-gap-and-remaining-gaps.md +0 -48
- data/TODO.diagrams/52-marker-registration-architecture.md +0 -89
- data/TODO.diagrams/53-remaining-example-gaps.md +0 -86
- data/TODO.diagrams/54-display-name-nested-classes.md +0 -40
- data/TODO.diagrams/55-visibility-icon-discriminator.md +0 -58
- data/TODO.diagrams/56-package-contents-rendering.md +0 -148
- data/TODO.diagrams/57-instance-specification-model.md +0 -100
- data/TODO.diagrams/58-domain-model-note-text.md +0 -67
- data/TODO.diagrams/59-classes-arrow-discriminator.md +0 -57
- data/TODO.diagrams/60-testschema-association-marker.md +0 -40
- data/TODO.diagrams/61-legend-block-rendering.md +0 -55
- data/TODO.diagrams/61-plateau-parity-gaps.md +0 -59
- data/TODO.diagrams/62-ghost-element-rendering.md +0 -56
- data/TODO.diagrams/63-qualified-name-wrap.md +0 -36
- data/TODO.diagrams/64-property-stereotype-labels.md +0 -22
- data/TODO.diagrams/65-path-coordinate-frame.md +0 -62
- data/TODO.diagrams/67-path-coordinate-frame.md +0 -62
- data/TODO.diagrams/68-inherited-attributes.md +0 -65
- data/TODO.diagrams/69-package-anchor-conditional.md +0 -29
- data/TODO.diagrams/70-mdg-technology-support.md +0 -68
- data/TODO.diagrams/71-off-canvas-parent-ghost.md +0 -45
- data/TODO.diagrams/72-basic-attr-divider-paths.md +0 -39
- data/TODO.diagrams/73-plateau-polygon-gap.md +0 -69
- data/TODO.diagrams/74-plateau-rect-gap.md +0 -22
- data/TODO.diagrams/75-plateau-text-gap.md +0 -39
- data/TODO.diagrams/76-basic-poly-path-gaps.md +0 -41
- data/TODO.diagrams/77-basic-text-overrender.md +0 -40
- data/TODO.diagrams/78-headerlines-ocp-refactor.md +0 -65
- data/TODO.diagrams/79-architecture-backlog.md +0 -65
- data/TODO.diagrams/80-basic-triangle-polygons.md +0 -51
- data/TODO.diagrams/81-plateau-path-overrender.md +0 -53
- data/TODO.diagrams/82-appearance-canvas-offset.md +0 -54
- data/TODO.diagrams/83-3d-diagram-subtitle.md +0 -58
- data/TODO.diagrams/84-canvas-offset-mismatches.md +0 -61
- data/TODO.diagrams/85-phantom-property-overrender.md +0 -95
- data/TODO.diagrams/86-foreign-package-rule.md +0 -62
- data/TODO.diagrams/87-internal-tech-encryption.md +0 -80
- data/TODO.diagrams/EXAMPLES_STATUS.md +0 -88
- data/TODO.diagrams/README.md +0 -69
- data/TODO.diagrams/STATUS.md +0 -73
- data/TODO.fixup/01-default-grouped-paths.md +0 -34
- data/TODO.fixup/02-marker-consolidation-per-connector.md +0 -20
- data/TODO.fixup/03-diagram-font-inference.md +0 -28
- data/TODO.fixup/04-extract-bounds-calculator.md +0 -25
- data/TODO.fixup/05-marker-registry-ocp.md +0 -32
- data/TODO.fixup/06-connector-path-bend-routing.md +0 -28
- data/TODO.fixup/07-edge-attachment-formula.md +0 -22
- data/TODO.fixup/08-visual-diff-harness.md +0 -28
- data/TODO.fixup/09-extract-element-compartments.md +0 -34
- data/TODO.fixup/10-canvas-width-overshoot-fix.md +0 -20
- data/TODO.fixup/11-layer-sequencer-extraction.md +0 -18
- data/TODO.fixup/12-path-style-harmony.md +0 -23
- data/TODO.fixup/13-datatype-stereotype-fallback.md +0 -28
- data/TODO.fixup/14-ea-exe-reverse-engineering-notes.md +0 -56
- data/TODO.fixup/15-enumeration-literal-rendering.md +0 -30
- data/TODO.fixup/16-operation-compartment-rendering.md +0 -42
- data/TODO.fixup/17-path-count-calibration.md +0 -27
- data/TODO.fixup/18-polygon-count-calibration.md +0 -32
- data/TODO.fixup/19-rect-count-undershoot-investigation.md +0 -40
- data/TODO.fixup/20-stereotype-color-from-classifier.md +0 -18
- data/TODO.fixup/21-visibility-filter-for-properties.md +0 -24
- data/TODO.fixup/22-multiplicity-display-rule-calibration.md +0 -25
- data/TODO.fixup/23-diagram-frame-title-element.md +0 -31
- data/TODO.fixup/24-note-element-rendering.md +0 -23
- data/TODO.fixup/25-ea-exe-disassembly-findings.md +0 -177
- data/TODO.fixup/26-svg-renderer-architecture.md +0 -78
- data/TODO.fixup/27-svg-element-emitters-disassembly.md +0 -135
- data/TODO.fixup/28-geometry-parser-identification.md +0 -57
- data/TODO.fixup/29-qea-svg-xmi-triple-comparison.md +0 -185
- data/TODO.fixup/30-theme-system-stub.md +0 -46
- data/TODO.fixup/31-theme-value-object-registry.md +0 -17
- data/TODO.fixup/32-styleex-on-diagram-model.md +0 -22
- data/TODO.fixup/33-text-encoding-decimals-rotation.md +0 -29
- data/TODO.fixup/34-per-type-fill-via-theme.md +0 -18
- data/TODO.fixup/35-stroke-width-per-theme.md +0 -7
- data/TODO.fixup/36-qea-rect-coord-normalization.md +0 -24
- data/TODO.fixup/37-package-shape-rendering.md +0 -22
- data/TODO.fixup/38-note-element-rendering.md +0 -15
- data/TODO.fixup/39-styleex-flag-honoring.md +0 -25
- data/TODO.fixup/40-connector-dashed-lines.md +0 -15
- data/TODO.fixup/41-diagram-frame-showborder-detection.md +0 -23
- data/TODO.fixup/42-textrenderer-centralization.md +0 -10
- data/TODO.fixup/43-colorresolver-unification.md +0 -24
- data/TODO.fixup/44-theme-aware-textrenderer.md +0 -17
- data/TODO.fixup/45-theme-aware-fontresolver.md +0 -22
- data/TODO.fixup/46-style-parameterized-by-theme.md +0 -21
- data/TODO.fixup/47-canvas-frame-inset.md +0 -19
- data/TODO.fixup/48-background-rect-format.md +0 -15
- data/TODO.fixup/49-all-samples-integration-test.md +0 -17
- data/TODO.fixup/50-svg-emitter-architecture-docs.md +0 -33
- data/TODO.fixup/51-promote-theme-to-ea-namespace.md +0 -28
- data/TODO.fixup/52-theme-definition-integrated-fills.md +0 -26
- data/TODO.fixup/53-theme-registry-yaml-loading.md +0 -50
- data/TODO.fixup/54-diagram-theme-api.md +0 -50
- data/TODO.fixup/55-update-eaemitter-to-ea-theme.md +0 -23
- data/TODO.fixup/56-theme-yaml-files.md +0 -65
- data/TODO.fixup/57-theme-specs-and-integration.md +0 -27
- data/TODO.fixup/58-ea-entry-point-theme-autoload.md +0 -20
- data/TODO.fixup/59-thread-theme-through-all-renderers.md +0 -29
- data/TODO.fixup/60-cli-theme-option.md +0 -22
- data/TODO.fixup/61-theme-validation.md +0 -28
- data/TODO.fixup/62-theme-builder-dsl.md +0 -31
- data/TODO.fixup/63-theme-integration-rendering-spec.md +0 -24
- data/TODO.fixup/64-theme-writeback-styleex.md +0 -21
- data/TODO.fixup/65-remove-dead-eaemitter-theme-files.md +0 -30
- data/TODO.fixup/66-styleex-writeback.md +0 -22
- data/TODO.fixup/67-delete-dead-code.md +0 -28
- data/TODO.fixup/68-figure-parity-status.md +0 -82
- data/TODO.fixup/69-package-polygon-rendering.md +0 -54
- data/TODO.fixup/70-tagged-values-compartment.md +0 -39
- data/TODO.fixup/71-auto-detect-theme-from-xmi.md +0 -37
- data/TODO.fixup/72-sample-exports-as-regression-specs.md +0 -37
- data/TODO.fixup/73-delete-dead-transformations.md +0 -14
- data/TODO.fixup/74-delete-dead-diagram-renderers.md +0 -18
- data/TODO.fixup/75-visibility-legend-icons.md +0 -23
- data/TODO.fixup/76-plateau-text-undershoot.md +0 -27
- data/TODO.fixup/77-canvas-frame-margins.md +0 -28
- data/TODO.fixup/78-note-element-rendering.md +0 -30
- data/TODO.fixup/79-operation-compartment-rendering.md +0 -27
- data/TODO.fixup/80-tagged-value-stereotype-visibility.md +0 -37
- data/TODO.fixup/81-figure-parity-current-state.md +0 -63
- data/TODO.next/00-publish-blocking-bugs.md +0 -74
- data/TODO.next/01-standalone-ea-gem-identity.md +0 -76
- data/TODO.next/02-optional-lutaml-uml-dependency.md +0 -47
- data/TODO.next/03-slim-lutaml-uml.md +0 -79
- data/TODO.next/04-loader-registry-for-uml-repository.md +0 -49
- data/TODO.next/05-extract-shared-transformer-methods.md +0 -14
- data/TODO.next/06-deduplicate-stereotype-loading.md +0 -17
- data/TODO.next/07-transformer-registry-in-factory.md +0 -20
- data/TODO.next/08-connector-type-registry.md +0 -27
- data/TODO.next/09-element-renderer-registry.md +0 -29
- data/TODO.next/10-connector-renderer-lsp.md +0 -18
- data/TODO.next/11-consolidate-style-knowledge.md +0 -33
- data/TODO.next/12-data-driven-from-db-row.md +0 -24
- data/TODO.next/13-extract-duplicated-methods.md +0 -17
- data/TODO.next/14-remove-dead-code.md +0 -10
- data/TODO.next/15-narrow-exception-handling.md +0 -39
- data/TODO.next/16-repository-indexes.md +0 -28
- data/TODO.next/17-fix-spec-quality-and-coverage.md +0 -32
- data/TODO.next/18-xmi-tool-specific-parser-architecture.md +0 -172
- data/TODO.next/19-fix-ea-gemspec-dependency-declarations.md +0 -56
- data/TODO.next/20-ci-requires-unreleased-lutaml-uml.md +0 -63
- data/TODO.next/21-qeatoxmi-via-xmi-gem.md +0 -340
- data/TODO.next/22-strip-respond-to-from-qeatoxmi-specs.md +0 -32
- data/TODO.next/23-cleanup-idallocator.md +0 -41
- data/TODO.next/24-tighten-parity-specs.md +0 -42
- data/TODO.next/25-sparx-eaid-format-for-synthesized-ids.md +0 -62
- data/TODO.next/26-fix-uppervalue-lowervalue-count-gap.md +0 -51
- data/TODO.next/27-extract-cardinality-module.md +0 -68
- data/TODO.next/28-extract-xml-sanitizer.md +0 -51
- data/TODO.next/29-ocp-registry-for-classifier-builders.md +0 -58
- data/TODO.next/30-struct-return-for-association-end.md +0 -37
- data/TODO.next/31-idallocator-specs.md +0 -27
- data/TODO.next/32-phase2-gap-sentinel-specs.md +0 -53
- data/TODO.next/33-normalize-lower-cleanup.md +0 -30
- data/TODO.next/34-document-member-end-order-rt-prefix.md +0 -29
- data/TODO.next/35-walk-runstate-for-instance-slots.md +0 -76
- data/TODO.next/36-wire-interface-realization.md +0 -50
- data/TODO.next/37-visibility-returns-real-booleans.md +0 -36
- data/TODO.next/38-xmi-parser-feature-parity.md +0 -75
- data/TODO.next/39-ea-spa-cli-command.md +0 -53
- data/TODO.next/40-drop-lur-only-check-in-diagrams-extract.md +0 -56
- data/TODO.refactor/01-ea-model-domain-layer.md +0 -64
- data/TODO.refactor/02-ea-model-qea-source-adapter.md +0 -58
- data/TODO.refactor/03-ea-model-xmi-source-adapter.md +0 -33
- data/TODO.refactor/04-ea-model-annotations-tagged-values.md +0 -34
- data/TODO.refactor/05-ea-model-diagrams-coordinates.md +0 -37
- data/TODO.refactor/06-spa-projection-layer.md +0 -45
- data/TODO.refactor/07-spa-sharded-output-strategy.md +0 -28
- data/TODO.refactor/08-spa-build-time-search-index.md +0 -24
- data/TODO.refactor/09-spa-frontend-data-contract.md +0 -25
- data/TODO.refactor/10-spa-cli-command-rework.md +0 -34
- data/TODO.refactor/11-spa-perf-benchmark.md +0 -23
- data/TODO.refactor/12-lutaml-uml-static-site-deprecation.md +0 -28
- data/TODO.release/01-release-lutaml-uml-030.md +0 -30
- data/TODO.release/02-fix-lutaml-meta-gem-requires.md +0 -33
- data/TODO.release/03-release-lutaml-0110.md +0 -20
- data/TODO.release/04-update-ea-gemspec-pin.md +0 -23
- data/TODO.release/05-remove-ea-conditional-requires.md +0 -48
- data/TODO.release/06-release-ea-020.md +0 -20
- data/TODO.release/07-migrate-plateau-model.md +0 -35
- data/TODO.release/README.md +0 -15
- data/docs/ea_to_uml_type_mapping.md +0 -89
- data/docs/xmi_qea_conversion_capabilities.md +0 -99
- data/examples/exports/20251010_current_plateau_v5/UML_EA.DTD +0 -6856
- data/examples/exports/20251010_current_plateau_v5/model.xml +0 -96709
- data/examples/exports/ArcGISWorkspace_template/UML_EA.DTD +0 -6856
- data/examples/exports/ArcGISWorkspace_template/model.xml +0 -1427
- data/examples/exports/UmlModel_template/UML_EA.DTD +0 -6856
- data/examples/exports/UmlModel_template/model.xml +0 -23
- data/examples/exports/basic/UML_EA.DTD +0 -6856
- data/examples/exports/basic/model.xml +0 -8039
- data/examples/exports/simple/UML_EA.DTD +0 -6856
- data/examples/exports/simple/model.xml +0 -585
- data/examples/exports/simple_example/UML_EA.DTD +0 -6856
- data/examples/exports/simple_example/model.xml +0 -23
- data/examples/exports/test/UML_EA.DTD +0 -6856
- data/examples/exports/test/model.xml +0 -1638
- data/examples/lur/20251010_current_plateau_v5.1.lur +0 -0
- data/examples/lur/basic.lur +0 -0
- data/examples/lur/test-output.lur +0 -0
- data/examples/lur/test.lur +0 -0
- data/examples/lur_basic_usage.rb +0 -221
- data/examples/lur_cli_workflow.rb +0 -263
- data/examples/lur_statistics.rb +0 -326
- data/examples/qea/20251010_current_plateau_v5.1.qea +0 -0
- data/examples/qea/ArcGISWorkspace_template.qea +0 -0
- data/examples/qea/README_qea_parser.adoc +0 -230
- data/examples/qea/UmlModel_template.qea +0 -0
- data/examples/qea/basic.qea +0 -0
- data/examples/qea/simple.qea +0 -0
- data/examples/qea/simple_example.qea +0 -0
- data/examples/qea/test.qea +0 -0
- data/examples/qea_standalone_query.rb +0 -73
- data/examples/qea_to_repository.rb +0 -51
- data/examples/smoke_test_real_qea.rb +0 -81
- data/frontend/README.md +0 -51
- data/frontend/dist/app.iife.js +0 -24
- data/frontend/dist/style.css +0 -1
- data/frontend/index.html +0 -26
- data/frontend/package-lock.json +0 -2359
- data/frontend/package.json +0 -26
- data/frontend/src/App.vue +0 -63
- data/frontend/src/app.ts +0 -8
- data/frontend/src/components/AppHeader.vue +0 -154
- data/frontend/src/components/AppSidebar.vue +0 -119
- data/frontend/src/components/ClassDetails.vue +0 -230
- data/frontend/src/components/DiagramView.vue +0 -92
- data/frontend/src/components/PackageDetails.vue +0 -133
- data/frontend/src/components/PackageTreeNode.vue +0 -69
- data/frontend/src/components/SearchResults.vue +0 -61
- data/frontend/src/components/WelcomeView.vue +0 -87
- data/frontend/src/shims-vue.d.ts +0 -5
- data/frontend/src/stores/dataStore.ts +0 -173
- data/frontend/src/stores/uiStore.ts +0 -166
- data/frontend/src/styles/main.css +0 -1566
- data/frontend/src/types.ts +0 -218
- data/frontend/tests/e2e/__screenshots__/new-dark-mode.png +0 -0
- data/frontend/tests/e2e/__screenshots__/new-package-details.png +0 -0
- data/frontend/tests/e2e/__screenshots__/new-search-modal.png +0 -0
- data/frontend/tests/e2e/__screenshots__/new-sidebar-collapsed.png +0 -0
- data/frontend/tests/e2e/__screenshots__/new-welcome.png +0 -0
- data/frontend/tests/e2e/render.spec.ts +0 -188
- data/frontend/tsconfig.json +0 -20
- data/frontend/vite.config.ts +0 -26
- data/frontend/vitest.config.ts +0 -8
- data/memory/deviations.md +0 -3
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-1-themes-list.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-1-themes.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-2-gradients.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-3-colors.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-4-appearance-fonts.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-4-appearance.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-5-behavior.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram-6-sequence.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-1-diagram.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-2-objects.png +0 -0
- data/reference-docs/enterprise-architect-appearance-dialogs/appearance-3-links.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 515072039a1723a02b86d982018e14d5589f136dc8bbb468110fb48c00c92b9c
|
|
4
|
+
data.tar.gz: 4aa92a3b722a8edcf8da96d4af095309d11b1492b3d49db5d571d1c13774b755
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08a7d4c03c831dfae2453f0f2e801dabfc9e0c530c2b29f18abfd4ad9a00c805b03be5a233d063d7d69b58b76a970ef5fec7411cab0503b3843a4b8c65d1d796'
|
|
7
|
+
data.tar.gz: 92094ceb4ca92a40d28543889b9de48a5466f2789fcbff331b6ac08629dcb7d36231b82c618ee5cfab2f7048d54a4fa7f02fbb96400cb86b512d2425d82b42b7
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Licenses & Copyright
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
This license file adheres to the formatting guidelines of
|
|
5
|
+
[readable-licenses](https://github.com/nevir/readable-licenses).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Ribose's BSD 2-Clause License
|
|
9
|
+
-----------------------------
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026, [Ribose Inc](https://www.ribose.com).
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
15
|
+
are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
25
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
33
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.adoc
CHANGED
|
@@ -20,8 +20,8 @@ For SPA generation (optional):
|
|
|
20
20
|
Or in your Gemfile:
|
|
21
21
|
|
|
22
22
|
source "https://rubygems.org"
|
|
23
|
-
gem "ea"
|
|
24
|
-
gem "lutaml-uml"
|
|
23
|
+
gem "ea"
|
|
24
|
+
gem "lutaml-uml" # optional: SPA + UML bridge + diagram rendering
|
|
25
25
|
|
|
26
26
|
== Quick start
|
|
27
27
|
|
|
@@ -140,10 +140,18 @@ QEA file ──→ Ea::Qea::Database ──→ Ea::Transformers::QeaToXmi ─
|
|
|
140
140
|
| `ea list FILE` | List model elements (auto-detects QEA or XMI)
|
|
141
141
|
| `ea diagrams list FILE` | List diagrams in a QEA/XMI file
|
|
142
142
|
| `ea diagrams extract FILE NAME` | Render a diagram to SVG
|
|
143
|
+
| `ea svg NAME FILE` | Render a diagram to standalone SVG
|
|
144
|
+
| `ea render NAME FILE` | Render a diagram to SVG/PNG/PDF
|
|
143
145
|
| `ea validate FILE` | Validate EA model
|
|
146
|
+
| `ea lint FILE` | Run model quality lint rules
|
|
144
147
|
| `ea stats FILE` | Show collection counts
|
|
145
|
-
| `ea parse FILE` | Parse to
|
|
148
|
+
| `ea parse FILE` | Parse QEA/XMI to a `Lutaml::Uml::Document` (requires lutaml-uml)
|
|
146
149
|
| `ea convert FILE --to xmi` | Convert QEA → Sparx XMI
|
|
150
|
+
| `ea diff OLD NEW` | Structural diff between two EA files (table/json/html)
|
|
151
|
+
| `ea export FILE --format xmi/json/plantuml/xsd` | Export the model
|
|
152
|
+
| `ea mdg FILE` | Inspect MDG technologies (list/show)
|
|
153
|
+
| `ea query FILE` | Filter model elements (type, package, stereotype)
|
|
154
|
+
| `ea info NAME FILE` | Show a single element's details
|
|
147
155
|
| `ea version` | Show gem version
|
|
148
156
|
|===
|
|
149
157
|
|
|
@@ -159,9 +167,9 @@ QEA file ──→ Ea::Qea::Database ──→ Ea::Transformers::QeaToXmi ─
|
|
|
159
167
|
git clone https://github.com/lutaml/ea
|
|
160
168
|
cd ea
|
|
161
169
|
bundle install
|
|
162
|
-
bundle exec rspec # run specs
|
|
170
|
+
bundle exec rspec # run specs
|
|
163
171
|
bundle exec ea help # see CLI commands
|
|
164
172
|
|
|
165
173
|
== License
|
|
166
174
|
|
|
167
|
-
|
|
175
|
+
BSD-2-Clause — see `LICENSE.md`.
|
data/lib/ea/cli/command/base.rb
CHANGED
|
@@ -47,12 +47,12 @@ module Ea
|
|
|
47
47
|
raise Ea::Cli::Error, "Failed to load #{path}: #{e.message}"
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
# Parse any EA file to a Lutaml::Uml::Document.
|
|
51
|
-
# Lazy-loads lutaml-uml via
|
|
50
|
+
# Parse any EA file (QEA or Sparx XMI) to a Lutaml::Uml::Document.
|
|
51
|
+
# Lazy-loads lutaml-uml via the bridge's require guard.
|
|
52
52
|
# @return [Lutaml::Uml::Document]
|
|
53
53
|
def parse_to_uml(path = file_path, **parse_options)
|
|
54
54
|
validate_file!(path)
|
|
55
|
-
Ea
|
|
55
|
+
Ea.to_uml(path, **parse_options)
|
|
56
56
|
rescue Ea::Cli::Error
|
|
57
57
|
raise
|
|
58
58
|
rescue Ea::Error => e
|
data/lib/ea/qea/database.rb
CHANGED
|
@@ -259,6 +259,11 @@ module Ea
|
|
|
259
259
|
@xrefs_by_client[ea_guid] || []
|
|
260
260
|
end
|
|
261
261
|
|
|
262
|
+
def attribute_tags_for_element(element_id)
|
|
263
|
+
ensure_lookup_indexes
|
|
264
|
+
@attribute_tags_by_element_id[element_id] || []
|
|
265
|
+
end
|
|
266
|
+
|
|
262
267
|
# Check if database is empty
|
|
263
268
|
#
|
|
264
269
|
# @return [Boolean] true if no collections loaded
|
|
@@ -357,6 +362,8 @@ module Ea
|
|
|
357
362
|
@properties_by_object_id = build_group_index(object_properties,
|
|
358
363
|
:ea_object_id)
|
|
359
364
|
@xrefs_by_client = build_group_index(xrefs, :client)
|
|
365
|
+
@attribute_tags_by_element_id = build_group_index(attribute_tags,
|
|
366
|
+
:element_id)
|
|
360
367
|
end
|
|
361
368
|
end
|
|
362
369
|
end
|
|
@@ -172,7 +172,7 @@ obj_pkg_name)
|
|
|
172
172
|
type_xmi_id: peer_obj.ea_guid,
|
|
173
173
|
association_xmi_id: ea_connector.ea_guid,
|
|
174
174
|
cardinality: cardinality,
|
|
175
|
-
definition: ea_connector.notes,
|
|
175
|
+
definition: normalize_note(ea_connector.notes),
|
|
176
176
|
gen_name: obj.name,
|
|
177
177
|
name_ns: obj_pkg_name,
|
|
178
178
|
type_ns: find_package_name(peer_obj.package_id),
|
|
@@ -47,8 +47,8 @@ module Ea
|
|
|
47
47
|
def format_notes(ea_tag)
|
|
48
48
|
return nil unless ea_tag.notes
|
|
49
49
|
|
|
50
|
-
# Clean up EA's note format
|
|
51
|
-
notes = ea_tag.notes.strip
|
|
50
|
+
# Clean up EA's note format (RTF when styled)
|
|
51
|
+
notes = Ea::Rtf.to_text(ea_tag.notes).strip
|
|
52
52
|
notes.empty? ? nil : notes
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -35,7 +35,7 @@ module Ea
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Map definition/notes
|
|
38
|
-
attr.definition =
|
|
38
|
+
attr.definition = normalize_note(ea_attribute.notes) unless
|
|
39
39
|
ea_attribute.notes.nil? || ea_attribute.notes.empty?
|
|
40
40
|
|
|
41
41
|
# Load and transform attribute tags
|
|
@@ -77,15 +77,10 @@ module Ea
|
|
|
77
77
|
return [] if attribute_id.nil?
|
|
78
78
|
return [] unless database.attribute_tags
|
|
79
79
|
|
|
80
|
-
# Filter attribute tags for this attribute from the in-memory
|
|
81
|
-
# collection
|
|
82
|
-
ea_tags = database.attribute_tags.select do |tag|
|
|
83
|
-
tag.element_id == attribute_id
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Transform to UML tagged values
|
|
87
80
|
tag_transformer = AttributeTagTransformer.new(database)
|
|
88
|
-
tag_transformer.transform_collection(
|
|
81
|
+
tag_transformer.transform_collection(
|
|
82
|
+
database.attribute_tags_for_element(attribute_id)
|
|
83
|
+
)
|
|
89
84
|
end
|
|
90
85
|
end
|
|
91
86
|
end
|
|
@@ -58,7 +58,8 @@ module Ea
|
|
|
58
58
|
if parts.size == 2
|
|
59
59
|
{ min: parts[0], max: parts[1] }
|
|
60
60
|
elsif parts.size == 1
|
|
61
|
-
|
|
61
|
+
# EA bare "*" means unbounded (0..*)
|
|
62
|
+
{ min: parts[0] == "*" ? "0" : parts[0], max: parts[0] }
|
|
62
63
|
else
|
|
63
64
|
{ min: nil, max: nil }
|
|
64
65
|
end
|
|
@@ -74,31 +75,30 @@ module Ea
|
|
|
74
75
|
value.to_s == "1" || value.to_s.downcase == "true"
|
|
75
76
|
end
|
|
76
77
|
|
|
77
|
-
# Normalize EA GUID to XMI ID format
|
|
78
|
-
#
|
|
78
|
+
# Normalize EA GUID to XMI ID format — the canonical conversion
|
|
79
|
+
# is Ea::GuidFormat, shared with the QEA→XMI exporter and the
|
|
80
|
+
# Sources adapters so both pipelines emit identical ids.
|
|
79
81
|
# @param ea_guid [String] EA GUID in format
|
|
80
82
|
# "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
|
|
81
83
|
# @param prefix [String] Prefix to add (e.g., "EAID", "EAPK")
|
|
82
84
|
# @return [String, nil] XMI ID in format
|
|
83
85
|
# "PREFIX_XXXXXXXX_XXXX_XXXX_XXXX_XXXXXXXXXXXX"
|
|
84
86
|
def normalize_guid_to_xmi_format(ea_guid, prefix = "EAID")
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
# Remove braces and replace hyphens with underscores
|
|
88
|
-
clean = ea_guid.tr("{}", "").tr("-", "_")
|
|
89
|
-
"#{prefix}_#{clean}"
|
|
87
|
+
Ea::GuidFormat.ea_guid_to_xmi_id(ea_guid, prefix: prefix)
|
|
90
88
|
end
|
|
91
89
|
|
|
92
|
-
# Convert ea_guid to XMI
|
|
90
|
+
# Convert ea_guid to the connector member-end XMI id (src/dst).
|
|
91
|
+
# Delegates to Ea::GuidFormat#connector_end_xmi_id — Sparx's
|
|
92
|
+
# convention drops the first two hex characters of the first
|
|
93
|
+
# GUID segment (verified against EA-exported XMI).
|
|
93
94
|
def normalize_guid_to_xmi_src_dst_format(
|
|
94
95
|
ea_guid, prefix = "EAID", is_src = true # rubocop:disable Style/OptionalBooleanParameter
|
|
95
96
|
)
|
|
96
|
-
xmi_id =
|
|
97
|
+
xmi_id = Ea::GuidFormat.ea_guid_to_xmi_id(ea_guid, prefix: prefix)
|
|
98
|
+
return nil if xmi_id.nil?
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
clean = xmi_id[(prefix.length + 3), xmi_id.length]
|
|
101
|
-
"#{prefix}_#{src_dst}#{clean}"
|
|
100
|
+
side = is_src ? :source : :destination
|
|
101
|
+
Ea::GuidFormat.connector_end_xmi_id(xmi_id, side: side)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
# Normalize line endings from Windows (\r\n) to Unix (\n)
|
|
@@ -111,6 +111,14 @@ module Ea
|
|
|
111
111
|
text.gsub("\r\n", "\n")
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
+
# Convert an EA note field (RTF when styled, plain otherwise)
|
|
115
|
+
# to normalized plain text
|
|
116
|
+
# @param text [String, nil] RTF or plain note text
|
|
117
|
+
# @return [String, nil] plain text with Unix line endings
|
|
118
|
+
def normalize_note(text)
|
|
119
|
+
normalize_line_endings(Ea::Rtf.to_text(text))
|
|
120
|
+
end
|
|
121
|
+
|
|
114
122
|
# Find object by ID
|
|
115
123
|
# @param object_id [Integer] Object ID
|
|
116
124
|
# @return [Models::EaObject, nil] EA object or nil
|
|
@@ -39,7 +39,7 @@ module Ea
|
|
|
39
39
|
def assign_definition(klass, ea_object)
|
|
40
40
|
return if ea_object.note.nil? || ea_object.note.empty?
|
|
41
41
|
|
|
42
|
-
klass.definition =
|
|
42
|
+
klass.definition = normalize_note(ea_object.note)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def assign_features(klass, ea_object)
|
|
@@ -24,7 +24,7 @@ module Ea
|
|
|
24
24
|
"EAID")
|
|
25
25
|
enum.visibility = map_visibility(ea_object.visibility)
|
|
26
26
|
enum.stereotype = [ea_object.stereotype] if valid_stereotype?(ea_object)
|
|
27
|
-
enum.definition = ea_object.note if note_present?(ea_object)
|
|
27
|
+
enum.definition = normalize_note(ea_object.note) if note_present?(ea_object)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def note_present?(ea_object)
|
|
@@ -64,7 +64,7 @@ module Ea
|
|
|
64
64
|
value.name = ea_attr.name
|
|
65
65
|
value.initial = present_text(ea_attr.default)
|
|
66
66
|
value.id = normalize_guid_to_xmi_format(ea_attr.ea_guid, "EAID")
|
|
67
|
-
value.definition =
|
|
67
|
+
value.definition = normalize_note(ea_attr.notes)
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -31,7 +31,7 @@ module Ea
|
|
|
31
31
|
|
|
32
32
|
# Map definition from ea_connector notes
|
|
33
33
|
if !ea_connector&.notes.nil? && !ea_connector&.notes&.empty?
|
|
34
|
-
gen.definition =
|
|
34
|
+
gen.definition = normalize_note(ea_connector.notes)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Map stereotype from current object
|
|
@@ -48,8 +48,8 @@ module Ea
|
|
|
48
48
|
def format_notes(ea_property)
|
|
49
49
|
return nil unless ea_property.notes
|
|
50
50
|
|
|
51
|
-
# Clean up EA's note format
|
|
52
|
-
notes = ea_property.notes.strip
|
|
51
|
+
# Clean up EA's note format (RTF when styled)
|
|
52
|
+
notes = Ea::Rtf.to_text(ea_property.notes).strip
|
|
53
53
|
notes.empty? ? nil : notes
|
|
54
54
|
end
|
|
55
55
|
end
|
|
@@ -21,7 +21,7 @@ module Ea
|
|
|
21
21
|
op.parameter_type = build_parameter_type(ea_operation)
|
|
22
22
|
|
|
23
23
|
# Map definition/notes
|
|
24
|
-
op.definition = ea_operation.notes unless
|
|
24
|
+
op.definition = normalize_note(ea_operation.notes) unless
|
|
25
25
|
ea_operation.notes.nil? || ea_operation.notes.empty?
|
|
26
26
|
|
|
27
27
|
# Map stereotype if present
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "sqlite3"
|
|
4
|
+
require "tmpdir"
|
|
4
5
|
|
|
5
6
|
module Ea
|
|
6
7
|
module Qea
|
|
@@ -22,6 +23,9 @@ module Ea
|
|
|
22
23
|
class DatabaseConnection
|
|
23
24
|
attr_reader :file_path, :connection
|
|
24
25
|
|
|
26
|
+
SQLITE_MAGIC = "SQLite format 3\x00"
|
|
27
|
+
ZIP_MAGIC = "PK\x03\x04"
|
|
28
|
+
|
|
25
29
|
# Initialize a new database connection
|
|
26
30
|
#
|
|
27
31
|
# @param file_path [String] Path to the .qea file
|
|
@@ -34,19 +38,24 @@ module Ea
|
|
|
34
38
|
|
|
35
39
|
@file_path = file_path
|
|
36
40
|
@connection = nil
|
|
41
|
+
@extracted_path = nil
|
|
37
42
|
end
|
|
38
43
|
|
|
39
44
|
# Connect to the database
|
|
40
45
|
#
|
|
46
|
+
# ZIP-compressed QEA archives are extracted to a temporary file
|
|
47
|
+
# first (removed when the connection closes).
|
|
48
|
+
#
|
|
41
49
|
# @return [SQLite3::Database] The database connection
|
|
42
50
|
# @raise [Errno::ENOENT] if the file does not exist
|
|
51
|
+
# @raise [Ea::Error] if the file is neither SQLite nor a ZIP archive
|
|
43
52
|
# @raise [SQLite3::Exception] if connection fails
|
|
44
53
|
def connect
|
|
45
54
|
unless File.exist?(@file_path)
|
|
46
55
|
raise Errno::ENOENT, "QEA file not found: #{@file_path}"
|
|
47
56
|
end
|
|
48
57
|
|
|
49
|
-
@connection = SQLite3::Database.new(
|
|
58
|
+
@connection = SQLite3::Database.new(openable_path, readonly: true)
|
|
50
59
|
@connection.results_as_hash = true
|
|
51
60
|
@connection
|
|
52
61
|
end
|
|
@@ -59,6 +68,7 @@ module Ea
|
|
|
59
68
|
|
|
60
69
|
@connection.close
|
|
61
70
|
@connection = nil
|
|
71
|
+
remove_extracted_file
|
|
62
72
|
end
|
|
63
73
|
|
|
64
74
|
# Check if the connection is open
|
|
@@ -94,6 +104,66 @@ module Ea
|
|
|
94
104
|
close if should_close
|
|
95
105
|
end
|
|
96
106
|
end
|
|
107
|
+
|
|
108
|
+
private
|
|
109
|
+
|
|
110
|
+
# Route to the raw file when it is a SQLite database, or to a
|
|
111
|
+
# fresh temporary extraction when it is a ZIP archive.
|
|
112
|
+
# @return [String] path SQLite can open
|
|
113
|
+
# @raise [Ea::Error] on any other file content
|
|
114
|
+
def openable_path
|
|
115
|
+
header = File.open(@file_path, "rb") { |f| f.read(16) } || ""
|
|
116
|
+
|
|
117
|
+
if header.start_with?(SQLITE_MAGIC)
|
|
118
|
+
@file_path
|
|
119
|
+
elsif header.start_with?(ZIP_MAGIC)
|
|
120
|
+
@extracted_path = extract_sqlite_from_zip
|
|
121
|
+
else
|
|
122
|
+
raise Ea::Error,
|
|
123
|
+
"#{@file_path} is not a QEA file: expected a SQLite " \
|
|
124
|
+
"database or a ZIP archive of one"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @return [String] path to the extracted SQLite file
|
|
129
|
+
# @raise [Ea::Error] when no SQLite database entry is in the archive
|
|
130
|
+
def extract_sqlite_from_zip
|
|
131
|
+
require "zip"
|
|
132
|
+
|
|
133
|
+
entry = sqlite_zip_entry or
|
|
134
|
+
raise Ea::Error,
|
|
135
|
+
"#{@file_path} is a ZIP archive but contains no " \
|
|
136
|
+
"SQLite database entry"
|
|
137
|
+
|
|
138
|
+
path = File.join(Dir.tmpdir, "ea-#{Process.pid}-#{Time.now.to_i}-" \
|
|
139
|
+
"#{File.basename(@file_path)}.sqlite")
|
|
140
|
+
File.binwrite(path, entry.get_input_stream.read)
|
|
141
|
+
path
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def sqlite_zip_entry
|
|
145
|
+
Zip::File.open(@file_path) do |zip_file|
|
|
146
|
+
files = zip_file.entries.select(&:file?)
|
|
147
|
+
named = files.select do |e|
|
|
148
|
+
e.name.end_with?(".qea", ".sqlite", ".eap")
|
|
149
|
+
end
|
|
150
|
+
named.max_by(&:size) || files.max_by(&:size)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def remove_extracted_file
|
|
155
|
+
return unless @extracted_path
|
|
156
|
+
|
|
157
|
+
File.delete(@extracted_path)
|
|
158
|
+
rescue Errno::ENOENT
|
|
159
|
+
nil
|
|
160
|
+
rescue StandardError
|
|
161
|
+
# On Windows a just-written temp file can still be locked
|
|
162
|
+
# (EACCES/EBUSY); dropping a temp file must never break close.
|
|
163
|
+
nil
|
|
164
|
+
ensure
|
|
165
|
+
@extracted_path = nil
|
|
166
|
+
end
|
|
97
167
|
end
|
|
98
168
|
end
|
|
99
169
|
end
|
|
@@ -58,23 +58,26 @@ module Ea
|
|
|
58
58
|
# @example With limit
|
|
59
59
|
# reader.all(limit: 10)
|
|
60
60
|
# # => Returns first 10 records
|
|
61
|
-
def all(limit: nil, offset: nil)
|
|
62
|
-
query =
|
|
63
|
-
params = []
|
|
64
|
-
|
|
65
|
-
if limit
|
|
66
|
-
query += " LIMIT ?"
|
|
67
|
-
params << limit
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
if offset
|
|
71
|
-
query += " OFFSET ?"
|
|
72
|
-
params << offset
|
|
73
|
-
end
|
|
74
|
-
|
|
61
|
+
def all(limit: nil, offset: nil)
|
|
62
|
+
query, params = build_select_query(limit: limit, offset: offset)
|
|
75
63
|
@database.execute(query, params)
|
|
76
64
|
end
|
|
77
65
|
|
|
66
|
+
# Stream records row-by-row without materializing the full
|
|
67
|
+
# result set (halves peak memory on large tables).
|
|
68
|
+
#
|
|
69
|
+
# @param limit [Integer, nil]
|
|
70
|
+
# @param offset [Integer, nil]
|
|
71
|
+
# @yieldparam row [Hash] one database row
|
|
72
|
+
# @return [void]
|
|
73
|
+
#
|
|
74
|
+
# @example
|
|
75
|
+
# reader.each_row { |row| models << Model.from_db_row(row) }
|
|
76
|
+
def each_row(limit: nil, offset: nil, &block)
|
|
77
|
+
query, params = build_select_query(limit: limit, offset: offset)
|
|
78
|
+
@database.execute(query, params, &block)
|
|
79
|
+
end
|
|
80
|
+
|
|
78
81
|
# Read records matching a WHERE clause
|
|
79
82
|
#
|
|
80
83
|
# @param conditions [String] The WHERE clause
|
|
@@ -227,6 +230,22 @@ module Ea
|
|
|
227
230
|
|
|
228
231
|
@database.execute(query, params)
|
|
229
232
|
end
|
|
233
|
+
|
|
234
|
+
private
|
|
235
|
+
|
|
236
|
+
def build_select_query(limit: nil, offset: nil)
|
|
237
|
+
query = +"SELECT * FROM #{@table_name}"
|
|
238
|
+
params = []
|
|
239
|
+
if limit
|
|
240
|
+
query << " LIMIT ?"
|
|
241
|
+
params << limit
|
|
242
|
+
end
|
|
243
|
+
if offset
|
|
244
|
+
query << " OFFSET ?"
|
|
245
|
+
params << offset
|
|
246
|
+
end
|
|
247
|
+
[query, params]
|
|
248
|
+
end
|
|
230
249
|
end
|
|
231
250
|
end
|
|
232
251
|
end
|
|
@@ -177,26 +177,42 @@ module Ea
|
|
|
177
177
|
|
|
178
178
|
total = reader.count
|
|
179
179
|
records = []
|
|
180
|
+
index = 0
|
|
180
181
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
record = model_class.from_db_row(row)
|
|
182
|
+
reader.each_row do |row|
|
|
183
|
+
index += 1
|
|
184
|
+
record = model_class.from_db_row(scrub_row(row))
|
|
184
185
|
records << record if record
|
|
185
186
|
if @progress_callback
|
|
186
|
-
report_progress(table_name, index
|
|
187
|
+
report_progress(table_name, index,
|
|
187
188
|
total)
|
|
188
189
|
end
|
|
189
190
|
rescue ArgumentError, TypeError, EncodingError => e
|
|
190
|
-
warn "Error loading
|
|
191
|
+
warn "Error loading #{table_name} row #{index}: #{e.message}"
|
|
191
192
|
rescue StandardError => e
|
|
192
193
|
# Catch-all for record-level failures: skip bad records,
|
|
193
194
|
# don't abort the entire load. Connection-level errors propagate.
|
|
194
|
-
warn "Unexpected error loading
|
|
195
|
+
warn "Unexpected error loading #{table_name} row #{index}: " \
|
|
196
|
+
"#{e.message}"
|
|
195
197
|
end
|
|
196
198
|
|
|
197
199
|
records
|
|
198
200
|
end
|
|
199
201
|
|
|
202
|
+
# Replace invalid byte sequences (e.g. CP1252 bytes stored by
|
|
203
|
+
# older EA projects) so one bad field no longer drops the whole
|
|
204
|
+
# row at model-build time.
|
|
205
|
+
#
|
|
206
|
+
# @param row [Hash] database row with string keys
|
|
207
|
+
# @return [Hash] row with UTF-8-clean string values
|
|
208
|
+
def scrub_row(row)
|
|
209
|
+
return row unless row.is_a?(Hash)
|
|
210
|
+
|
|
211
|
+
row.transform_values do |value|
|
|
212
|
+
value.is_a?(String) ? value.scrub : value
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
200
216
|
# Report progress to callback
|
|
201
217
|
#
|
|
202
218
|
# @param table_name [String] Current table
|
data/lib/ea/query/builder.rb
CHANGED
|
@@ -104,7 +104,7 @@ module Ea
|
|
|
104
104
|
xrefs.select do |xr|
|
|
105
105
|
xr.client == object.ea_guid && xr.description&.include?("@STEREO")
|
|
106
106
|
end.map do |xr|
|
|
107
|
-
xr.description.match(/Name=([^;]+)/)
|
|
107
|
+
xr.description.match(/Name=([^;]+)/)&.captures&.first
|
|
108
108
|
end.compact
|
|
109
109
|
end
|
|
110
110
|
private :stereotype_names_for
|