ea 0.6.5 → 0.6.7

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: 9d4eb047626f932a223d59f60d7a07ac839542e16f1f08cc1e27f99102592af7
4
- data.tar.gz: d38407abf49dd80a886269968e944edfa691bc09ca31772556d8d20a89dac294
3
+ metadata.gz: d066021fc111c616534f8445aa46fc1217d16bd06e5a7555634033b692d1023c
4
+ data.tar.gz: b09455921b726464c95e69a918a916eccc7b6caa66675493e84438eea62c6000
5
5
  SHA512:
6
- metadata.gz: 50d22ea166bdb5ee80f60a16d2396dc12b90470d1c9f5048279ee9e9d4233b7778af481f04719618416f59d26ada1ddb750bbda03e8fd9f6c4abc1c279ecd9a1
7
- data.tar.gz: 9ac1166cc762bce236ca889b8a28f26bb32f3688fa00ce925b53f91adf5999976057aefe91e4b684fdf55adbca352af6bd4f5901e9b5251ba0b29c21999becd5
6
+ metadata.gz: 1b388387a89b3d933b8a7c6667c70134da049679cdbc2ef3d3c2aa11937228cd8b0ef55b3509c780b47f5ce437d93a4641e356bd84562929d65ea0012466a67c
7
+ data.tar.gz: be2f5b42394a8a3be5eeeb7bff3d48b6929d47009823f632c105e59f2f2ec33652b9bf6e4fa5a5194c20bf8e74c194a1d3448b6a32ab3f1d145bc59f9ab056bf
@@ -94,6 +94,15 @@ module Ea
94
94
  tagged_values_for(classifier).size,
95
95
  header_lines)
96
96
  end
97
+ # EA suppresses the operations compartment when its rows
98
+ # overflow the stored box height (same rule as attributes).
99
+ if op_lines.any? && geometry.op_first_y &&
100
+ geometry.op_bottom_y.to_i + size > bounds.y + bounds.height
101
+ op_lines = []
102
+ geometry = compartment_geometry(bounds, size, attr_lines, op_lines,
103
+ tagged_values_for(classifier).size,
104
+ header_lines)
105
+ end
97
106
  RenderContext.new(
98
107
  element: element,
99
108
  bounds: bounds,
@@ -122,13 +122,23 @@ module Ea
122
122
  assoc = association_for(connector)
123
123
  return [nil, nil, nil] unless assoc
124
124
 
125
- prop = property_at_end(assoc, end_kind)
125
+ prop = property_at_end(assoc, end_kind, connector)
126
126
  return [true, *property_role(prop)] if prop
127
127
 
128
128
  [false, *association_role(assoc, end_kind)]
129
129
  end
130
130
 
131
- def property_at_end(association, end_kind)
131
+ def property_at_end(association, end_kind, connector = nil)
132
+ # EA renders the source classifier's synthesized
133
+ # association-end property (matched by the connector's
134
+ # relationship guid), falling back to the property index
135
+ # lookup by association source/target id.
136
+ if connector&.relationship_ref
137
+ placed = placed_classifier_id(association, end_kind)
138
+ prop = assoc_end_property(placed, connector.relationship_ref)
139
+ return prop if prop
140
+ end
141
+
132
142
  id = end_kind == :source ? association.source_id : association.target_id
133
143
  return nil unless id
134
144
 
@@ -137,9 +147,29 @@ module Ea
137
147
  fallback_property_lookup(id)
138
148
  end
139
149
 
150
+ def placed_classifier_id(association, end_kind)
151
+ end_kind == :source ? association.source_id : association.target_id
152
+ end
153
+
154
+ # Find the synthesized association-end property on the
155
+ # placed classifier whose association_id matches the
156
+ # connector's relationship reference.
157
+ def assoc_end_property(classifier_id, relationship_ref)
158
+ return nil unless classifier_id
159
+
160
+ classifier = model_index[classifier_id]
161
+ return nil unless classifier.is_a?(Ea::Model::Classifier)
162
+
163
+ (classifier.properties || []).find do |p|
164
+ p.association_id == relationship_ref
165
+ end
166
+ end
167
+
140
168
  # Linear-scan fallback for callers that did not wire in
141
169
  # the Document. Production paths go through Document's
142
170
  # property_index for O(1) lookup.
171
+
172
+
143
173
  def fallback_property_lookup(id)
144
174
  return nil unless model_index
145
175
 
@@ -155,11 +185,23 @@ module Ea
155
185
  def property_role(property)
156
186
  visibility = visibility_prefix(property)
157
187
  name = property.name.to_s
158
- role = name.empty? ? nil : "#{visibility}#{name}"
188
+ type_name = property.type_name.to_s
189
+ line = if type_name.empty? || type_name == " "
190
+ "#{visibility}#{name}"
191
+ else
192
+ "#{visibility}#{name}: #{namespace_double_colon(type_name)}"
193
+ end
194
+ role = line.empty? ? nil : line
159
195
  mult = multiplicity_text(property)
160
196
  [role, mult]
161
197
  end
162
198
 
199
+ def namespace_double_colon(type_name)
200
+ return type_name if type_name.nil? || type_name.empty?
201
+
202
+ type_name.to_s.gsub(/([A-Za-z0-9_]):([A-Za-z])/, '\1::\2')
203
+ end
204
+
163
205
  def association_role(assoc, end_kind)
164
206
  name = end_kind == :source ? assoc.source_role_name : assoc.target_role_name
165
207
  lower = end_kind == :source ? assoc.source_multiplicity_lower : assoc.target_multiplicity_lower
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.5"
7
+ VERSION = "0.6.7"
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.5
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.