yaml2erd 0.4.0 → 0.5.0

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: 713fa7bae57f1a43bc0cb36d3512b5e11e6c0a052602d37e5b2edfb3ff1ee254
4
- data.tar.gz: '049f87a45acc4f05105e6ac3198365a556c58e68a67913bdcdd3ff14e1f4abf1'
3
+ metadata.gz: 3850dbeb1221f38ca3aa3b5e9e17698a6d85d6e1bc31a69618d000c3df16f1a4
4
+ data.tar.gz: 1e4bf1354d0781a8766a13ccd38a91f4e3c9eb71172bbdc5d2da379ef39388b9
5
5
  SHA512:
6
- metadata.gz: 9213646a34afb98d6c2010230183bccb78244b8ccfa8e4df363cf7fb97aeac113434d21e84bec70e33d137c1ee196bf2916a7af4167eb80e8c8283f70bddf9cb
7
- data.tar.gz: 62e1dfd95cdc553e9ab80fa3f29c2eab90294b9f292830a9250596d8b461670e671d81df8ab8936ab7b151c9919144026bf0b6f5ba6dc356c49401d5efa427e2
6
+ metadata.gz: ccbbd27c4923761bfab989bab49248aa34ec0595d165ec2dc5fd43ea42b1112cced84a6b014ca9f1413f75cfdab9c9edfad2926270ef21a728c81e5f47a72c60
7
+ data.tar.gz: ae016ea85279a000b7140b44398bebf0f58fedd8e6aa255b0684b2c2d380e232e41a5ee34c16c910b22b416190f172dd6482c067916ba37cf1de225ae70c9fd3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaml2erd (0.4.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.2)
20
+ i18n (1.5.3)
21
21
  concurrent-ruby (~> 1.0)
22
22
  minitest (5.11.3)
23
23
  rake (10.5.0)
@@ -18,37 +18,25 @@ class Yaml2erd
18
18
  説明
19
19
  ].freeze
20
20
 
21
- CUSTOMIZABLE_CONF = {
21
+ DEFAULT_CONF = {
22
22
  global_conf: {
23
- layout: 'fdp',
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: { arrowsize: 3, penwidth: 4, len: 10 },
39
- has_one: { arrowsize: 3, penwidth: 4, len: 10 }
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
- customized_conf.deep_merge(NOT_CUSTOMIZABLE_CONF)
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)
@@ -1,3 +1,3 @@
1
1
  class Yaml2erd
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
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.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-27 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport