ea 0.6.56 → 0.6.57

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: 295c984dad1eacc74382ca861c06b7c7e96313244f41df7a69f5e8292e9be26c
4
- data.tar.gz: ae1c580213464dda7c7754fc2f7e09e8e7b5a4fb678ccf20f6dff8246aa39ca8
3
+ metadata.gz: 0d2d511dfae5cb1f0378d6cb5b8785175a2eb0e66909d7b27af8aed1a69bb4dd
4
+ data.tar.gz: e4ef5fb783b6275b9a771f6eda84bda5eacccf0d9cc16cb928d07c2501509589
5
5
  SHA512:
6
- metadata.gz: 2472e05bef6dbce5a483645415acb8cb65e2908478384faa7a75af492589cc522c45e775c8a0dca4d49f79fb6ffb4f8e5da6346ab667c7820a7eea6d6418752c
7
- data.tar.gz: 5c29eaa5a065744cf6cac9e738514fc6929a59a9c41f4726e266763a5738649b55a1b5321fb9278242ad3ddd1d18dbd1faf421cfc8dd52625db5fb05d0f6cccd
6
+ metadata.gz: 43b36c1e7c8572148d7edf5580639ebb381d99f4568ebceb5407e4b58bb542d38facbbff35dac0e467213abc797af61b033ba7a465a4d49ee218a76f45efc863
7
+ data.tar.gz: 21f1441cc886e09aee22617c7b5d3f430b5322028db431d219ede3c6fd21e64b27535686ff62632599e91c25bfa124a43c6c0a152594d7e13085033451cae390
@@ -269,15 +269,33 @@ module Ea
269
269
  if first.last == :italic || first.last == :italic_tight
270
270
  6 # ghost-led: EA seats the right-aligned ghost at +13
271
271
  elsif first.first.to_s.start_with?("«")
272
- enumeration_or_interface?(classifier) ? 6 : 9
272
+ fallback_stereotype_label?(first.first, classifier) ? 6 : 9
273
273
  else
274
274
  theme.compartments.header_top_padding
275
275
  end
276
276
  end
277
277
 
278
- def enumeration_or_interface?(classifier)
279
- classifier.is_a?(Ea::Model::Enumeration) ||
280
- classifier.is_a?(Ea::Model::Interface)
278
+ # EA seats the FALLBACK stereotype label («enumeration»,
279
+ # «interface», … from the element TYPE with no stored
280
+ # stereotype) 3px higher than a class name; EXPLICIT
281
+ # stereotype labels («CodeList», «TopLevelFeatureType»)
282
+ # keep the class padding (C45FC57E's «CodeList» seats at
283
+ # +16 while fallback «enumeration» boxes seat at +13).
284
+ FALLBACK_LABELS = {
285
+ Ea::Model::Enumeration => "«enumeration»",
286
+ Ea::Model::Interface => "«interface»",
287
+ Ea::Model::DataType => "«dataType»",
288
+ Ea::Model::PrimitiveType => "«primitive»",
289
+ Ea::Model::Signal => "«signal»"
290
+ }.freeze
291
+
292
+ def fallback_stereotype_label?(label, classifier)
293
+ return false if classifier.respond_to?(:stereotype_refs) &&
294
+ classifier.stereotype_refs&.any?
295
+
296
+ FALLBACK_LABELS.any? do |type, expected|
297
+ classifier.is_a?(type) && label == expected
298
+ end
281
299
  end
282
300
 
283
301
  # t_diagram pdata HideEStereo=1 suppresses every stereotype
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.56"
7
+ VERSION = "0.6.57"
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.56
4
+ version: 0.6.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.