xmi 0.6.0 → 0.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db371f76bfe7fa3b6f16392f150e7bdd4a70b390053317de58ae11ea4d469fa8
4
- data.tar.gz: b5d0ac779b25967ba94abaa37ec726414a296680c313d451dbc7f3ec230ab4f1
3
+ metadata.gz: 3cc49c1f04320b672d11b3bff319bc4aee6695a59b3989595af4f2e92e0a62f9
4
+ data.tar.gz: 8f366089bc8ad283935a06aa8b1191a54be1a26ed81014a692e59abdd26d332a
5
5
  SHA512:
6
- metadata.gz: 6caff8c35f558fb0394b45cea65f04094ffc546b69844f2a7d8ce1fa946a1e961ece15e5569ae170a82e33b57dd007ea313e0f3d6c966251ef18d4dcefe8d94b
7
- data.tar.gz: e3f580a640f314257ecd3a0c8d387dbb4e2136c7845b17dbaa99e79ab3b3bda00eb4291c77dcb3e9089bdb3bafdd8396a501b64c5b1faab291eb0f703bc1aa46
6
+ metadata.gz: c90c0d2a39bc0d17452e87f8bf11ac9cb5349c1fda65b7bf65bbea2ee5e57e85f87e7b07ef3da805f75f7d12bf4eb8be2375ad777faeeee993410bdf1b4d950f
7
+ data.tar.gz: 7d7d33c2bde1c98942542733af1e53d2f7e66a6f57cd1421763b7d5b6e2b3a79fc9232953442fbac89135abf747cb0ba995efaaf7e40f85d3ddac23e94e1b0d4
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ # UML `<packagedElement xmi:type="uml:Component">`. Modular unit
6
+ # of structure and behavior (UML 2.5 §12.3). Carries the same
7
+ # child-element surface as UmlClass — owned_attribute,
8
+ # owned_operation, owned_comment, generalization,
9
+ # interface_realization — but signals a different deployment role
10
+ # to consumers.
11
+ #
12
+ # Phase A of TODO.next/01: subclass is a type tag on
13
+ # PackagedElement. The union-bag attribute set is inherited
14
+ # unchanged so existing consumers keep working.
15
+ class Component < PackagedElement
16
+ end
17
+ end
18
+ end
@@ -10,9 +10,17 @@ module Xmi
10
10
  # Phase A of TODO.next/01: subclasses are type tags on
11
11
  # PackagedElement (no attrs narrowed). Phase B will narrow each
12
12
  # subclass's attrs to its UML-2.5-conformant subset.
13
+ #
14
+ # Fallback contract: unknown or missing `xmi:type` resolves to
15
+ # `Xmi::Uml::PackagedElement` (the union-bag base) via the
16
+ # class_map's default_proc. This avoids the lutaml-model
17
+ # `Object.const_get(nil)` TypeError when a Sparx XMI emits a
18
+ # type we haven't modelled yet, at the cost of treating the
19
+ # element as generic. polymorphic_robustness_spec locks in the
20
+ # graceful-fallback behavior.
13
21
  PACKAGED_ELEMENT_POLYMORPHIC_MAP = {
14
22
  attribute: "xmi:type",
15
- class_map: {
23
+ class_map: Hash.new("Xmi::Uml::PackagedElement").merge!(
16
24
  "uml:Class" => "Xmi::Uml::UmlClass",
17
25
  "uml:Association" => "Xmi::Uml::Association",
18
26
  "uml:AssociationClass" => "Xmi::Uml::AssociationClass",
@@ -28,7 +36,8 @@ module Xmi
28
36
  "uml:Extension" => "Xmi::Uml::Extension",
29
37
  "uml:Stereotype" => "Xmi::Uml::Stereotype",
30
38
  "uml:Usage" => "Xmi::Uml::Usage",
31
- },
39
+ "uml:Component" => "Xmi::Uml::Component",
40
+ ),
32
41
  }.freeze
33
42
 
34
43
  class PackagedElement < Base
@@ -31,16 +31,21 @@ module Xmi
31
31
  #
32
32
  # The literal class names are string form because lutaml-model's
33
33
  # resolve_polymorphic_class calls Object.const_get on the value.
34
+ #
35
+ # Fallback contract: unknown or missing `xmi:type` resolves to
36
+ # `Xmi::Uml::ValueSpecification` (the abstract base) via the
37
+ # class_map's default_proc. polymorphic_robustness_spec locks in
38
+ # the graceful-fallback behavior.
34
39
  VALUE_SPECIFICATION_POLYMORPHIC_MAP = {
35
40
  attribute: "xmi:type",
36
- class_map: {
41
+ class_map: Hash.new("Xmi::Uml::ValueSpecification").merge!(
37
42
  "uml:OpaqueExpression" => "Xmi::Uml::OpaqueExpression",
38
43
  "uml:LiteralString" => "Xmi::Uml::LiteralString",
39
44
  "uml:LiteralInteger" => "Xmi::Uml::LiteralInteger",
40
45
  "uml:LiteralBoolean" => "Xmi::Uml::LiteralBoolean",
41
46
  "uml:LiteralUnlimitedNatural" => "Xmi::Uml::LiteralUnlimitedNatural",
42
47
  "uml:LiteralNull" => "Xmi::Uml::LiteralNull",
43
- },
48
+ ),
44
49
  }.freeze
45
50
  end
46
51
  end
data/lib/xmi/uml.rb CHANGED
@@ -43,6 +43,7 @@ module Xmi
43
43
  autoload :Extension, "xmi/uml/extension"
44
44
  autoload :Stereotype, "xmi/uml/stereotype"
45
45
  autoload :Usage, "xmi/uml/usage"
46
+ autoload :Component, "xmi/uml/component"
46
47
  autoload :Bounds, "xmi/uml/bounds"
47
48
  autoload :Waypoint, "xmi/uml/waypoint"
48
49
  autoload :OwnedElement, "xmi/uml/owned_element"
data/lib/xmi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xmi
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-07 00:00:00.000000000 Z
11
+ date: 2026-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -164,6 +164,7 @@ files:
164
164
  - lib/xmi/uml/association_generalization.rb
165
165
  - lib/xmi/uml/base.rb
166
166
  - lib/xmi/uml/bounds.rb
167
+ - lib/xmi/uml/component.rb
167
168
  - lib/xmi/uml/data_type.rb
168
169
  - lib/xmi/uml/default_value.rb
169
170
  - lib/xmi/uml/dependency.rb