mermaid 0.0.5 → 0.0.6

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: 4f8673a2e417bd0f9067c4bc37a418e53f12121bd53583d532d993b84ebed6e9
4
- data.tar.gz: 144b8ea752c9f1d2fbb97bb3ebb87d5bc3a2c57deca834f218e3cfb44f45c48d
3
+ metadata.gz: 82eb20d2315cbe0cf01d624664b573947d891b7f142d531a47805531724232b1
4
+ data.tar.gz: '02801805d9f7361fd32e575f0db38cfcafbcf92a542c47eae9990c554c2d1924'
5
5
  SHA512:
6
- metadata.gz: 1c7a6525e9cdcf568fc17579481f7a2c786f5e78d34ed1170bb33e6de1b33c115082e6eb9d55eaa8be518f3d0789ec7848ccb29cd633bfb3dc155dfbc86025fc
7
- data.tar.gz: 2d80d1bec74fe89c505eaf9dbe77429a1b2cabd13cd416480dc153b8206738935f88fcb613fc91905288c8771fbeba77268aa3956a6a7258e8dc7d470dac90d9
6
+ metadata.gz: 471e35230eeab9df0e9dd6bb4d42bdfc386027af84defb2e20a2b3ca4b0244fa68dc30090a2a5480e06279e94862a58daaa954eaeafca22ffda9abb65932a85a
7
+ data.tar.gz: 06bc39252e24a72bec57c1566876921010d1319ee171571d61d8acc1ec499038d70dc311201ad6702d8ef45372f10b3d415eb66251f08777a773d429ca92140e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.6](https://github.com/seuros/mermaid-ruby/compare/mermaid/v0.0.5...mermaid/v0.0.6) (2025-08-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * conform to mermaid standard syntax. This will allow user to gene… ([9081725](https://github.com/seuros/mermaid-ruby/commit/90817257b7b7a8bab28b1aff250ee5ac83eaa85c))
9
+ * conform to mermaid standard syntax. This will allow user to generate ERD compatible with Github ([f6574b5](https://github.com/seuros/mermaid-ruby/commit/f6574b54f959f15e9d37f88709fe21b77987293a))
10
+
3
11
  ## [0.0.5](https://github.com/seuros/mermaid-ruby/compare/mermaid/v0.0.4...mermaid/v0.0.5) (2025-07-11)
4
12
 
5
13
 
@@ -10,8 +10,22 @@ module Mermaid
10
10
  fragment = "\"#{name}\" {\n"
11
11
  entity_attributes.each do |attr|
12
12
  fragment << " #{attr.type} #{attr.name}"
13
- # Join keys like PK, FK with spaces if present
14
- fragment << " #{attr.keys.join(' ')}" unless attr.keys.empty?
13
+
14
+ # Separate Mermaid-native constraints from comment-only constraints
15
+ unless attr.keys.empty?
16
+ native_keys = attr.keys.select { |key| %i[PK FK].include?(key) }
17
+ comment_keys = attr.keys.select { |key| [:UK].include?(key) }
18
+
19
+ # Add native keys first
20
+ fragment << " #{native_keys.join(' ')}" unless native_keys.empty?
21
+
22
+ # Quote UK as comment to mark it as comment
23
+ comment_keys.each do |key|
24
+ fragment << " \"#{key}\""
25
+ end
26
+ end
27
+
28
+ # Add explicit comment if present
15
29
  fragment << " \"#{attr.comment}\"" if attr.comment && !attr.comment.empty?
16
30
  fragment << "\n"
17
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mermaid
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mermaid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih