yml2erd 0.9.7 → 0.9.8
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 +4 -4
- data/lib/yml2erd/diagram.rb +11 -7
- data/lib/yml2erd/schema_structure.rb +6 -0
- data/lib/yml2erd/version.rb +1 -1
- data/sample.yml +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2559f6e066eeec7dec8fa5b69954f31ac61e6fb
|
|
4
|
+
data.tar.gz: ea165d8d635601f4b932f6b44c93a6aa58f12263
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b42de50a6a3e97539534a550963fae46fdc8278ce2199fc807269b6c94ba9e8aa3933b0bb1b545f5f722c7f561058315b23f42eb23c7c5393d9f11ecad6c3487
|
|
7
|
+
data.tar.gz: cb1a0a5595feaaae8b6edbb2e19bea23972f4b4729cc4d56fcd82e5d3ef5ff0eef04585adf18b52633bb46c630d5c78b1ce9122f3a8b7d097ad55c3151344bef
|
data/lib/yml2erd/diagram.rb
CHANGED
|
@@ -20,7 +20,8 @@ module Yml2erd
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
index = schema_structure.index(table_name)
|
|
23
|
-
|
|
23
|
+
comment = schema_structure.comment(table_name)
|
|
24
|
+
label = build_label(table_name, columns, index, comment)
|
|
24
25
|
g.add_nodes(table_name, shape: "record", label: label, style: "rounded")
|
|
25
26
|
end
|
|
26
27
|
|
|
@@ -40,12 +41,15 @@ module Yml2erd
|
|
|
40
41
|
end
|
|
41
42
|
end
|
|
42
43
|
|
|
43
|
-
def build_label(table_name, columns, index)
|
|
44
|
-
if index
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
def build_label(table_name, columns, index, comment)
|
|
45
|
+
partial ||= "| indexed: #{index.to_s}" if index
|
|
46
|
+
partial += "| #{comment}" if comment
|
|
47
|
+
base_label(table_name, columns, partial)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# TODO: Contemplates method name
|
|
51
|
+
def base_label(table_name, columns, partial = nil)
|
|
52
|
+
base = "<{<FONT POINT-SIZE='15'>#{table_name}</FONT> | #{columns}#{partial}}>"
|
|
49
53
|
end
|
|
50
54
|
|
|
51
55
|
def build_column(name, type)
|
data/lib/yml2erd/version.rb
CHANGED
data/sample.yml
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yml2erd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- asmsuechan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby-graphviz
|