ea 0.6.74 → 0.6.76

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: b9c1ef6bdc2910e595f6273edf3c1174ad436e97cf1e64fe36eebe987aaae2f9
4
- data.tar.gz: 225f122ba3ad0b656676727487830b8627690a939826bfdc47a8cefd5b3a0e4a
3
+ metadata.gz: 8d640b92ddedcf36076a62091fc344a08b85622ede3bee3855541d6705a2ebde
4
+ data.tar.gz: ebe4c9068300d79db3aeb0e42494c0dc6175ad638e8e3ca580b39d007fef7170
5
5
  SHA512:
6
- metadata.gz: 6d529c6c5341f735f8bc322b2be5e98d2ef4227aac85c30fe6fe54c1a66ca6f802c921a5bf1615ddef2d89944da8d5e79e7b9550926fe99167561dd7f80fe61a
7
- data.tar.gz: 3f21953290853b36681e25b87332edd9aba7c0de8f40794c83e16dab896658a5a1627026cae8c0e941d4754ff0bb09ca6aab6b207646acb76dde982ad1c7ee4a
6
+ metadata.gz: 8b025f70911f4c5648c2dce0cc314d2b4276c849cb653886bc0e1276d8d61362af98ffd529089415cd15359b1a04d1f866bf71adbbd183fc76b1b689bb41c68f
7
+ data.tar.gz: c682bb77194678ea2652a0e23a1d595c35b0e31d11a94c93ffebbbbf6a55beb3424e148a4dfd9293bf1509faf59430d1bf438eb743527f4f9550d82e4ef57709
@@ -17,6 +17,7 @@ module Ea
17
17
  # column value is non-numeric; rendered as-is by the SVG line
18
18
  # builder while computed-unbounded uppers render as "*".
19
19
  attribute :multiplicity_upper_raw, :string # -1 means "many"
20
+ attribute :multiplicity_lower_raw, :string # literal text bounds ("size")
20
21
  # Verbatim stored cardinality text (e.g. "*", "1..1", "n") for
21
22
  # association ends; EA renders connector-end multiplicities
22
23
  # exactly as stored rather than from parsed bounds.
@@ -30,6 +30,7 @@ module Ea
30
30
  type_name: normalize_type(row.type),
31
31
  qualified_name: "#{owner_object.name}::#{row.name}",
32
32
  multiplicity_lower: parse_lower(row),
33
+ multiplicity_lower_raw: raw_bound(row.lowerbound),
33
34
  multiplicity_upper_raw: raw_upper(row),
34
35
  multiplicity_upper: parse_upper(row),
35
36
  default_value: row.default,
@@ -52,7 +53,17 @@ module Ea
52
53
  # render as "*" (verified against EA-published SVGs).
53
54
  def raw_upper(row)
54
55
  raw = row.upperbound.to_s
55
- raw.match?(/\A[nN]\z/) ? raw.downcase : nil
56
+ return raw.downcase if raw.match?(/\A[nN]\z/)
57
+
58
+ raw_bound(raw)
59
+ end
60
+
61
+ # Literal text bounds EA displays verbatim in brackets
62
+ # ('elements: Character [size]' - LowerBound/UpperBound both
63
+ # 'size').
64
+ def raw_bound(value)
65
+ raw = value.to_s
66
+ raw.empty? || raw.match?(/\A\d+\z/) ? nil : raw
56
67
  end
57
68
 
58
69
  def normalize_type(type)
@@ -100,8 +100,16 @@ module Ea
100
100
  def multiplicity
101
101
  lower = property.multiplicity_lower
102
102
  upper = property.multiplicity_upper
103
+ if lower == 1 && upper == 1
104
+ raw = property.multiplicity_lower_raw
105
+ # Literal text bounds EA displays verbatim ('elements:
106
+ # Character [size]' - stored bounds 'size'/'size' parse
107
+ # to the 1..1 default).
108
+ return "[#{raw}]" if raw && raw == property.multiplicity_upper_raw
109
+
110
+ return ""
111
+ end
103
112
  return "" if lower.nil? && upper.nil?
104
- return "" if lower == 1 && upper == 1
105
113
 
106
114
  "[#{lower || 0}..#{bound_text(upper)}]"
107
115
  end
@@ -121,10 +121,17 @@ module Ea
121
121
  # EA's op block: first row 21 below the last attribute row
122
122
  # (9pt... 7pt: attr_bottom + 21), uniform 13px pitch across
123
123
  # attrs AND ops (6D4C665D: attrs ..520, ops 541..658 step 13).
124
+ # Attribute-empty boxes anchor on the divider instead:
125
+ # first op at divider + 14 (001A64C1: EA ops 104 vs our
126
+ # 125 when attrs were absent).
124
127
  def op_first_y
125
128
  return nil unless op_lines_count&.positive?
126
129
 
127
- attr_bottom_y + size + 14
130
+ if attr_lines_count.to_i.positive?
131
+ attr_bottom_y + size + 14
132
+ else
133
+ divider_y + size + 7
134
+ end
128
135
  end
129
136
 
130
137
  def op_bottom_y
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.74"
7
+ VERSION = "0.6.76"
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.74
4
+ version: 0.6.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.