This repository has been archived by the owner on Jan 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
outline.sh
103 lines (86 loc) · 3.14 KB
/
outline.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# Proper header for a Bash script.
file_mi='notes/1-file_list-misc.txt'
file_mo='notes/1-file_list-models.txt'
file_co='notes/1-file_list-controllers.txt'
file_vi='notes/1-file_list-views.txt'
d_mo='notes/diagram-models.svg'
d_co='notes/diagram-controllers.svg'
echo '----------'
echo 'Annotating'
bundle exec annotate --routes
bundle exec annotate
mkdir -p notes
echo '-------------------------------------------'
echo 'Listing the helper and mailer files in file'
echo $file_mi
echo 'This file was AUTOMATICALLY generated by the list_files.sh script.' > $file_mi
echo '-------------------' >> $file_mi
echo 'HELPERS AND MAILERS' >> $file_mi
ls -R1 -I concerns test/*helper.rb >> $file_mi
echo '' >> $file_mi
ls -R1 -I concerns app/helpers >> $file_mi
echo '' >> $file_mi
echo '-------------------------------'
echo 'Listing the model files in file'
echo $file_mo
echo 'This file was AUTOMATICALLY generated by the list_files.sh script.' > $file_mo
echo '------' >> $file_mo
echo 'MODELS' >> $file_mo
echo '' >> $file_mo
ls -R1 -I concerns test/unit >> $file_mo
echo '' >> $file_mo
ls -R1 -I concerns test/fixtures >> $file_mo
echo '' >> $file_mo
ls -R1 -I concerns test/factories >> $file_mo
echo '' >> $file_mo
ls -R1 -I concerns app/models >> $file_mo
echo 'This file was AUTOMATICALLY generated by the list_files.sh script.' > $file_co
echo '-----------' >> $file_co
echo 'CONTROLLERS' >> $file_co
ls -R1 -I concerns test/functional >> $file_co
echo '' >> $file_co
ls -R1 -I concerns app/controllers >> $file_co
echo 'This file was AUTOMATICALLY generated by the list_files.sh script.' > $file_vi
echo '---------------------------' >> $file_vi
echo 'VIEWS AND INTEGRATION TESTS' >> $file_vi
echo '' >> $file_vi
echo '----------------' >> $file_vi
echo 'config/routes.rb' >> $file_vi
cat config/routes.rb >> $file_vi
echo '----------------' >> $file_vi
echo '' >> $file_vi
ls -R1 -I concerns test/integration >> $file_vi
echo '' >> $file_vi
ls -R1 -I concerns app/views >> $file_vi
echo 'FINISHED compiling the list of files that make up the MVC structure'
echo '-------------------------------------------------------------------'
echo '---------------'
echo 'Using rails-erd'
bundle exec erd --attributes=foreign_keys,primary_keys,timestamps,inheritance,content --filetype=dot --filename=notes/diagram-models --inheritance --notation=bachman
dot -Tsvg notes/diagram-models.dot > notes/diagram-models.svg
rm notes/diagram-models.dot
echo
echo 'Models diagram is at notes/diagram-models.svg'
echo
echo '---------------'
echo 'Using railroady'
railroady -i -l TestLabel -v -a --all-columns -j -m -p -z -t --engine-controllers -C | dot -Tsvg > notes/diagram-controllers.svg
echo
echo 'Controllers diagram is at notes/diagram-controllers.svg'
echo
echo '------------------------------'
echo 'Drawing gem dependency diagram'
bundle viz --file=notes/diagram-gems --format=svg --requirements --version
echo '*************'
echo 'OUTPUT FILES:'
echo $file_mi
echo $file_mo
echo $file_co
echo $file_vi
echo $d_mo
echo $d_co
echo 'notes/diagram-gems.svg'
echo
echo 'NOTE: You may need to update the outline.sh script if any of'
echo 'its underlying assumptions about this app are incorrect.'