yaml2erd 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/yaml2erd.rb +7 -38
- data/lib/yaml2erd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3850dbeb1221f38ca3aa3b5e9e17698a6d85d6e1bc31a69618d000c3df16f1a4
|
4
|
+
data.tar.gz: 1e4bf1354d0781a8766a13ccd38a91f4e3c9eb71172bbdc5d2da379ef39388b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccbbd27c4923761bfab989bab49248aa34ec0595d165ec2dc5fd43ea42b1112cced84a6b014ca9f1413f75cfdab9c9edfad2926270ef21a728c81e5f47a72c60
|
7
|
+
data.tar.gz: ae016ea85279a000b7140b44398bebf0f58fedd8e6aa255b0684b2c2d380e232e41a5ee34c16c910b22b416190f172dd6482c067916ba37cf1de225ae70c9fd3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yaml2erd (0.
|
4
|
+
yaml2erd (0.5.0)
|
5
5
|
activesupport (~> 5.2)
|
6
6
|
gviz (~> 0.3.5)
|
7
7
|
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
diff-lcs (1.3)
|
18
18
|
gviz (0.3.5)
|
19
19
|
thor
|
20
|
-
i18n (1.5.
|
20
|
+
i18n (1.5.3)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
22
|
minitest (5.11.3)
|
23
23
|
rake (10.5.0)
|
data/lib/yaml2erd.rb
CHANGED
@@ -18,37 +18,25 @@ class Yaml2erd
|
|
18
18
|
説明
|
19
19
|
].freeze
|
20
20
|
|
21
|
-
|
21
|
+
DEFAULT_CONF = {
|
22
22
|
global_conf: {
|
23
|
-
layout: '
|
23
|
+
layout: 'dot',
|
24
24
|
splines: 'ortho',
|
25
|
-
K: 5
|
26
25
|
},
|
27
26
|
entity_conf: {
|
28
27
|
shape: 'Mrecord',
|
29
28
|
fontname: 'Noto Sans CJK JP Black',
|
30
|
-
fontsize: 20
|
29
|
+
fontsize: 20,
|
31
30
|
},
|
32
31
|
group_conf: {
|
33
32
|
shape: 'Mrecord',
|
34
33
|
fontname: 'Noto Sans CJK JP Black',
|
35
|
-
fontsize: 40
|
34
|
+
fontsize: 40,
|
36
35
|
},
|
37
36
|
arrow_map: {
|
38
|
-
has_many: {
|
39
|
-
has_one: {
|
40
|
-
}
|
41
|
-
}.freeze
|
42
|
-
|
43
|
-
NOT_CUSTOMIZABLE_CONF = {
|
44
|
-
global_conf: {
|
45
|
-
overlap: false,
|
46
|
-
sep: '+1'
|
37
|
+
has_many: {},
|
38
|
+
has_one: {},
|
47
39
|
},
|
48
|
-
arrow_map: {
|
49
|
-
has_many: { arrowhead: 'crow', arrowtail: 'tee', dir: 'both' },
|
50
|
-
has_one: { arrowhead: 'tee', arrowtail: 'tee', dir: 'both' }
|
51
|
-
}
|
52
40
|
}.freeze
|
53
41
|
|
54
42
|
# TODO: nodesとglobalの違いみたいなの調査
|
@@ -110,27 +98,8 @@ class Yaml2erd
|
|
110
98
|
end
|
111
99
|
end
|
112
100
|
|
113
|
-
# CUSTOMIZABLE_CONFとキー重複しているものだけ適用
|
114
|
-
customized_conf = merge_keep_struct(CUSTOMIZABLE_CONF.dup, user_conf)
|
115
|
-
|
116
101
|
# ユーザ設定取り込んで、固定値をマージして返す
|
117
|
-
|
118
|
-
end
|
119
|
-
|
120
|
-
def merge_keep_struct(base_hash, input_hash)
|
121
|
-
input_hash.each do |key, val|
|
122
|
-
# input_hashのネストが深すぎる時にエラーになるからtry
|
123
|
-
next unless base_hash.try(:keys).try(:include?, key)
|
124
|
-
|
125
|
-
if val.is_a?(Hash)
|
126
|
-
base_hash[key] = merge_keep_struct(base_hash[key], input_hash[key])
|
127
|
-
else
|
128
|
-
# input_hashのネストが浅すぎる時(inputは底までついたけどbaseはまだhashの時)はスルーするように
|
129
|
-
next if base_hash[key].is_a?(Hash)
|
130
|
-
base_hash[key] = val
|
131
|
-
end
|
132
|
-
end
|
133
|
-
base_hash
|
102
|
+
DEFAULT_CONF.deep_merge(user_conf)
|
134
103
|
end
|
135
104
|
|
136
105
|
def apply_conf(conf)
|
data/lib/yaml2erd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml2erd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rh-taro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01
|
11
|
+
date: 2019-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|