ea 0.6.179 → 0.6.180

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: 11c68c4ae95c4aece187d82d4900e945aa3023b08dd56344074d0b3e705b2fa4
4
- data.tar.gz: 6ce9387721e57248f66a511ce1621c25afef3f5a41a59189a262b6dce2b0992c
3
+ metadata.gz: 9871a436545f50a0aa046015be229cfddc4c48524d6ba55c75f6c4ed1f86bc80
4
+ data.tar.gz: 5a976b280ed90ba30a5c557a7f9e6b06a7c342c35ca970fc9fb8773d0997ac23
5
5
  SHA512:
6
- metadata.gz: d3e13c1455a4ff2c2141c3e500bf5d968d8d1d9f126c4d13d27942179048c9b659d8c1b3ec7926e583ae433e6d017a6d305671a1babb4678c480c5fc4e24a173
7
- data.tar.gz: 19cd5c58eee413f32d4442f30d65494b1e9da1a20a1d43649e3cf4fc01dcd0010e2ae5a735948a5cba60ac4c0641aebd3170c9005da19bc278865d6982e363e1
6
+ metadata.gz: 1c7bd8a7ced8456f71d05be1d54d6831d362a48a848fe5e2d013419f7895e1cf0945e393ffb5f0e3aeaa938fb7abf2e027cbad870c868f729b6d3787e69d4559
7
+ data.tar.gz: 7591da0c653deaa6381cdb8e200a8ab411fd4b6fc9f83a55cf16d3da6326b70d3d2968f29bac94e127c3a155a924c78c2206b04e79bb2b5c48e545b2997d6dce
@@ -459,6 +459,9 @@ module Ea
459
459
  @connectors_by_end.each do |id, conns|
460
460
  (@connectors_by_object[id] ||= []).concat(conns)
461
461
  end
462
+ # A reflexive connector (start and end on the same object) is in
463
+ # both indexes, so it reaches the merged list twice.
464
+ @connectors_by_object.each_value(&:uniq!)
462
465
  end
463
466
 
464
467
  def build_diagram_indexes
@@ -94,11 +94,13 @@ module Ea
94
94
  end
95
95
 
96
96
  # Convert an EA note field (RTF when styled, plain otherwise)
97
- # to normalized plain text
97
+ # to normalized plain text, stripped as the XMI parser reads it
98
+ # (a plain note's trailing newline otherwise separates a table
99
+ # row directive from its cell and the directive renders as text)
98
100
  # @param text [String, nil] RTF or plain note text
99
101
  # @return [String, nil] plain text with Unix line endings
100
102
  def normalize_note(text)
101
- normalize_line_endings(Ea::Rtf.to_text(text))
103
+ normalize_line_endings(Ea::Rtf.to_text(text))&.strip
102
104
  end
103
105
 
104
106
  # Find object by ID
@@ -43,11 +43,29 @@ module Ea
43
43
  # Load associations for this data type
44
44
  data_type.associations = load_associations(ea_object.ea_object_id,
45
45
  ea_object.ea_guid)
46
+
47
+ # As in the XMI export, the generalization hangs off the data
48
+ # type only when it declares a parent.
49
+ data_type.generalization = load_generalization(
50
+ ea_object.ea_object_id
51
+ )
46
52
  end
47
53
  end
48
54
 
49
55
  private
50
56
 
57
+ # The generalization of a data type that has a parent; nil for a root one
58
+ # @param object_id [Integer] Object ID
59
+ # @return [Lutaml::Uml::Generalization, nil] UML generalization
60
+ def load_generalization(object_id)
61
+ connector = Ea::Qea::Rules::Generalization.connector_for(
62
+ object_id, database.connectors_for_object(object_id)
63
+ )
64
+ return nil unless connector
65
+
66
+ GeneralizationBuilder.new(database).load_generalization(object_id)
67
+ end
68
+
51
69
  # Load associations for a data type
52
70
  # @param object_id [Integer] Object ID
53
71
  # @param object_guid [String] Object GUID
data/lib/ea/version.rb CHANGED
@@ -4,5 +4,5 @@ module Ea
4
4
  # Gem release version. Extracted to its own file so the
5
5
  # `gem-release` tool's `gem bump` can find and update it via the
6
6
  # standard `lib/<gem>/version.rb` convention.
7
- VERSION = "0.6.179".freeze
7
+ VERSION = "0.6.180".freeze
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.179
4
+ version: 0.6.180
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.