-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuml.rb
48 lines (43 loc) · 1.15 KB
/
uml.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require "csv"
essence = {
'opportunity.csv' => 'class 機会',
'stakeholders.csv' => 'class ステークホルダー',
'requirements.csv' => 'class 要求',
'software-system.csv' => 'class ソフトウェアシステム',
'work.csv' => 'class 作業',
'team.csv' => 'class チーム',
'way-of-working.csv' => 'class 作業方法'
}
icons = {
'opportunity.csv' => '<< (C,lightgreen) >>',
'stakeholders.csv' => '<< (C,lightgreen) >>',
'requirements.csv' => '<< (S,yellow) >>',
'software-system.csv' => '<< (S,yellow) >>',
'team.csv' => '<< (E,lightblue) >>',
'work.csv' => '<< (E,lightblue) >>',
'way-of-working.csv' => '<< (E,lightblue) >>'
}
puts "@startuml"
essence.keys.each do |csv|
header = essence[csv]
icon = icons[csv]
open(csv) do |f|
state_num = 0
while line = f.gets
k, v = CSV.parse(line)[0]
next if k.nil? or v.nil?
if k.include? "□"
puts " -#{v}"
else
state_num += 1
puts "}" if f.lineno != 1
puts "#{header}(#{state_num}) #{icon} {"
puts "#{v}"
puts "--"
end
end
puts "}"
end
end
puts "hide empty members"
puts "@enduml"