ea 0.6.81 → 0.6.82

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: 77a102cf8d5f979c2a0c08effe4a042deb9d070fd9244927a19f874eebabf9bc
4
- data.tar.gz: 29424bbe2040f7b2881a6cd9c9b48726795f9b8fd59023d3eee5ca89cc62453d
3
+ metadata.gz: f49b146105c3770154c2e142bd0e762a5a055ba6ecdaebeb5fc0a69dc8bda54d
4
+ data.tar.gz: 6e9f3d7a47493dafca74ce0f5b6a97974e1ec6f7260945af4863ae605b7d3825
5
5
  SHA512:
6
- metadata.gz: 2d3ecedd46016a29080cf8980c301078917f6b90d45087e8538dba856e87386b457388eea4b309a540019686c1a984dc76e2ab055a8075943de27292c5e65ab2
7
- data.tar.gz: c78a7f6134a5b238ea67043fbc5f30c2572611f575a6fbe61dd15d583e687a0312da7ace32c7783f880914badced7a975043e6e94ca0a58db2fe2a130d3b99b0
6
+ metadata.gz: d7d3b746d276197b249cba7a087f015a439c8644ee2a6b719e55122a28d3c36a56f90e5db6ba8d695bb21543022bade8c5534f69c3b49a91d5a9542715211c2b
7
+ data.tar.gz: 00b735266e78b014d1bf128a353aea5563b90b2a4f5b861cf4eed1ca934d18d340429af54c36d7ac51229f37cf9c1bc5d4974181af4333daa27ba102ed96ba1f
@@ -30,6 +30,7 @@ module Ea
30
30
  attribute :line_color, :integer
31
31
  attribute :line_width, :integer
32
32
  attribute :hidden, :boolean
33
+ attribute :is_substitutable, :boolean, default: false
33
34
  attribute :label_boxes, :hash, default: -> { {} }
34
35
  attribute :ghost_labels, GhostLabel, collection: true, initialize_empty: true
35
36
  # True when the t_diagramlinks.Geometry string carries explicit
@@ -59,6 +60,7 @@ module Ea
59
60
  map "sourceElementRef", to: :source_element_ref
60
61
  map "targetElementRef", to: :target_element_ref
61
62
  map "sourceDuid", to: :source_duid
63
+ map "isSubstitutable", to: :is_substitutable
62
64
  map "targetDuid", to: :target_duid
63
65
  map "sourceEdge", to: :source_edge
64
66
  map "targetEdge", to: :target_edge
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "set"
4
+
3
5
  module Ea
4
6
  module Sources
5
7
  module Qea
@@ -10,6 +12,20 @@ module Ea
10
12
  class DiagramBuilder
11
13
  attr_reader :database
12
14
 
15
+ # Generalizations whose EA CustomProperties carry
16
+ # isSubstitutable draw '{isSubstitutable=false}' at the label
17
+ # seat (t_xref 'connector property' rows keyed by connector
18
+ # guid; VALU 0/empty both mean false).
19
+ def substitutable_connector?(conn)
20
+ @substitutable_guids ||= database.collections[:xrefs]
21
+ .select do |x|
22
+ x.xref_type == "connector property" &&
23
+ x.name == "CustomProperties" &&
24
+ x.description.to_s.include?("isSubstitutable")
25
+ end.map(&:client).to_set
26
+ @substitutable_guids.include?(conn.ea_guid)
27
+ end
28
+
13
29
  def initialize(database)
14
30
  @database = database
15
31
  end
@@ -188,6 +204,7 @@ module Ea
188
204
  target_stereotype: conn.deststereotype,
189
205
  waypoints: waypoints,
190
206
  label_boxes: {},
207
+ is_substitutable: substitutable_connector?(conn),
191
208
  # Only the Dependency family carries EA's double-back
192
209
  # "M t L s M t" byte form; regenerated generalizations
193
210
  # and associations draw as plain source-first lines
@@ -249,6 +266,7 @@ module Ea
249
266
  connector_type: conn.connector_type,
250
267
  waypoints: waypoints,
251
268
  label_boxes: {},
269
+ is_substitutable: substitutable_connector?(conn),
252
270
  style: { direct: true },
253
271
  hidden: false,
254
272
  has_geometry_offsets: false
@@ -384,7 +402,8 @@ module Ea
384
402
  DiagramStyleParser.parse(link_row.style),
385
403
  hidden: hidden?(link_row),
386
404
  ghost_labels: ghost_labels_for(connector, diagram_row, link_row),
387
- has_geometry_offsets: geometry_has_offsets?(link_row.geometry)
405
+ has_geometry_offsets: geometry_has_offsets?(link_row.geometry),
406
+ is_substitutable: substitutable_connector?(connector)
388
407
  )
389
408
  end
390
409
 
@@ -62,6 +62,14 @@ module Ea
62
62
  # Returns the midpoint label content: stereotype if
63
63
  # present, else the relationship Name.
64
64
  def midpoint_content(connector)
65
+ # Generalizations carrying EA's isSubstitutable
66
+ # CustomProperty draw the constraint at the label seat.
67
+ if connector.respond_to?(:is_substitutable) &&
68
+ connector.is_substitutable &&
69
+ stereotype_label(connector).nil?
70
+ return "{isSubstitutable=false}"
71
+ end
72
+
65
73
  stereotype = stereotype_label(connector)
66
74
  return stereotype if stereotype
67
75
 
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.81"
7
+ VERSION = "0.6.82"
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.81
4
+ version: 0.6.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.