ea 0.6.71 → 0.6.72
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8e91b80d0c035a0deb3122b5ac8cd20b482ff6c49e6fab312d4a003602bc5a1
|
|
4
|
+
data.tar.gz: bccd0383c8f54915b80e028f4fa7e8468bb0ab71a09508d1e2e35a39682e3892
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ec29aeeb4158f28141c881b67f07b3fa92fa834f05e478a1ea812827e679842754797e6e0bf195c106a96e63fc657d929bf3eecd9894379de7d473d5e9ed78d
|
|
7
|
+
data.tar.gz: 6be8d9f42a0e5a9d88cbe0dabca9242021aef148ef2bdbf5731a9b226173aae4da68931cfbc9b89ed23148e530e2632c98299a121e4b1fe45388b71c9f292948
|
|
@@ -12,6 +12,27 @@ module Ea
|
|
|
12
12
|
DEFAULT_CONTENT_X_OFFSET = 22
|
|
13
13
|
|
|
14
14
|
DEFAULT_FONT_UNIT = "pt"
|
|
15
|
+
# EA seats each group-header row («...» following a
|
|
16
|
+
# non-stereotype row) 4px below the uniform pitch (XSD
|
|
17
|
+
# schema diagrams: attr row 68 -> «XSDelement» 85 -> row 98;
|
|
18
|
+
# single-header boxes like «Property» sit at the first row
|
|
19
|
+
# and keep the plain pitch).
|
|
20
|
+
GROUP_HEADER_LEAD = 4
|
|
21
|
+
|
|
22
|
+
def self.group_lead_offsets(lines)
|
|
23
|
+
extra = 0
|
|
24
|
+
lines.each_with_index.map do |line, idx|
|
|
25
|
+
stereo = line.to_s.strip.start_with?("«")
|
|
26
|
+
prev_stereo = idx.positive? ? lines[idx - 1].to_s.strip.start_with?("«") : true
|
|
27
|
+
extra += GROUP_HEADER_LEAD if stereo && idx.positive? && !prev_stereo
|
|
28
|
+
extra
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.group_lead_total(lines)
|
|
33
|
+
group_lead_offsets(lines).last.to_i
|
|
34
|
+
end
|
|
35
|
+
|
|
15
36
|
# EA seats compartment stereotype headers («Property») 12px
|
|
16
37
|
# from the box edge and spaces rows 13px at 7pt.
|
|
17
38
|
STEREOTYPE_HEADER_X_OFFSET = 12
|
|
@@ -32,9 +53,10 @@ module Ea
|
|
|
32
53
|
content_x_offset: nil)
|
|
33
54
|
|
|
34
55
|
line_h = size + ROW_LINE_OFFSET
|
|
56
|
+
offsets = group_lead_offsets(lines)
|
|
35
57
|
text_blocks = []
|
|
36
58
|
lines.each_with_index do |line, idx|
|
|
37
|
-
y = first_y + (idx * line_h)
|
|
59
|
+
y = first_y + (idx * line_h) + offsets[idx]
|
|
38
60
|
visibility, rest = split_visibility(line)
|
|
39
61
|
if visibility
|
|
40
62
|
unless visibility.strip.empty?
|
|
@@ -39,6 +39,7 @@ module Ea
|
|
|
39
39
|
divider_offset: 8,
|
|
40
40
|
attr_line_offset: 6,
|
|
41
41
|
attr_first_offset: 7,
|
|
42
|
+
attr_group_lead: 0,
|
|
42
43
|
header_ghost: false,
|
|
43
44
|
header_ghost_tight: false)
|
|
44
45
|
@bounds = bounds
|
|
@@ -55,6 +56,7 @@ module Ea
|
|
|
55
56
|
@divider_offset = divider_offset
|
|
56
57
|
@attr_line_offset = attr_line_offset
|
|
57
58
|
@attr_first_offset = attr_first_offset
|
|
59
|
+
@attr_group_lead = attr_group_lead
|
|
58
60
|
@header_ghost = header_ghost
|
|
59
61
|
@header_ghost_tight = header_ghost_tight
|
|
60
62
|
end
|
|
@@ -108,7 +110,8 @@ module Ea
|
|
|
108
110
|
def attr_bottom_y
|
|
109
111
|
return attr_first_y unless attr_lines_count&.positive?
|
|
110
112
|
|
|
111
|
-
attr_first_y + (attr_lines_count - 1) * (size + (attr_line_offset || 6))
|
|
113
|
+
attr_first_y + (attr_lines_count - 1) * (size + (attr_line_offset || 6)) +
|
|
114
|
+
@attr_group_lead.to_i
|
|
112
115
|
end
|
|
113
116
|
|
|
114
117
|
def op_divider_y
|
|
@@ -176,7 +176,8 @@ module Ea
|
|
|
176
176
|
header_lines, classifier: classifier,
|
|
177
177
|
constraints_count: constraints_for(classifier).size,
|
|
178
178
|
marker_count: marker_lines_for(classifier).size,
|
|
179
|
-
enum_literals_count: enum_row_count_for(classifier)
|
|
179
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
180
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
180
181
|
# EA suppresses the whole attribute compartment when its
|
|
181
182
|
# rows do not fit the stored box height (never truncates
|
|
182
183
|
# rows) - the AOS box on CityFurniture hides its
|
|
@@ -198,7 +199,8 @@ module Ea
|
|
|
198
199
|
header_lines, classifier: classifier,
|
|
199
200
|
constraints_count: constraints_for(classifier).size,
|
|
200
201
|
marker_count: marker_lines_for(classifier).size,
|
|
201
|
-
enum_literals_count: enum_row_count_for(classifier)
|
|
202
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
203
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
202
204
|
end
|
|
203
205
|
# EA suppresses the operations compartment when its rows
|
|
204
206
|
# overflow the stored box height (same rule as attributes)
|
|
@@ -217,7 +219,8 @@ module Ea
|
|
|
217
219
|
header_lines, classifier: classifier,
|
|
218
220
|
constraints_count: constraints_for(classifier).size,
|
|
219
221
|
marker_count: marker_lines_for(classifier).size,
|
|
220
|
-
enum_literals_count: enum_row_count_for(classifier)
|
|
222
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
223
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
221
224
|
elsif op_lines.any? && geometry.op_first_y &&
|
|
222
225
|
geometry.op_bottom_y.to_i > bounds.y + bounds.height
|
|
223
226
|
op_lines = []
|
|
@@ -226,7 +229,8 @@ module Ea
|
|
|
226
229
|
header_lines, classifier: classifier,
|
|
227
230
|
constraints_count: constraints_for(classifier).size,
|
|
228
231
|
marker_count: marker_lines_for(classifier).size,
|
|
229
|
-
enum_literals_count: enum_row_count_for(classifier)
|
|
232
|
+
enum_literals_count: enum_row_count_for(classifier),
|
|
233
|
+
attr_group_lead: Element::AttributeRenderer.group_lead_total(attr_lines))
|
|
230
234
|
end
|
|
231
235
|
# Real attributes grow the DRAWN box past the stored
|
|
232
236
|
# height instead of being dropped (0CABA7D7: stored h44
|
|
@@ -295,7 +299,8 @@ module Ea
|
|
|
295
299
|
def compartment_geometry(bounds, size, attr_lines, op_lines,
|
|
296
300
|
tagged_count, header_lines, classifier: nil,
|
|
297
301
|
constraints_count: 0, marker_count: 0,
|
|
298
|
-
enum_literals_count: 0
|
|
302
|
+
enum_literals_count: 0,
|
|
303
|
+
attr_group_lead: 0)
|
|
299
304
|
CompartmentGeometry.new(bounds: bounds, size: size,
|
|
300
305
|
header_ghost: header_lines.any? &&
|
|
301
306
|
%i[italic italic_tight].include?(header_lines.first.last),
|
|
@@ -312,7 +317,8 @@ module Ea
|
|
|
312
317
|
header_line_offset: theme.compartments.header_line_offset,
|
|
313
318
|
divider_offset: divider_offset_for(header_lines, classifier),
|
|
314
319
|
attr_line_offset: theme.compartments.attr_line_offset,
|
|
315
|
-
attr_first_offset: attr_first_offset_for(attr_lines)
|
|
320
|
+
attr_first_offset: attr_first_offset_for(attr_lines),
|
|
321
|
+
attr_group_lead: attr_group_lead)
|
|
316
322
|
end
|
|
317
323
|
|
|
318
324
|
# EA seats a stereotype line 3px higher than a bare class name
|
data/lib/ea/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.6.72
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -14,16 +14,16 @@ dependencies:
|
|
|
14
14
|
name: lutaml-model
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
19
|
+
version: '0.8'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
26
|
+
version: '0.8'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: lutaml-path
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -56,16 +56,16 @@ dependencies:
|
|
|
56
56
|
name: rubyzip
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
61
|
+
version: '3.7'
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - "
|
|
66
|
+
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
68
|
+
version: '3.7'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: xmi
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,16 +98,16 @@ dependencies:
|
|
|
98
98
|
name: liquid
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - "
|
|
101
|
+
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '
|
|
103
|
+
version: '5'
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- - "
|
|
108
|
+
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '
|
|
110
|
+
version: '5'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: thor
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|