graphviz-diagram 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/Gemfile +4 -0
- data/Guardfile +16 -0
- data/LICENSE.txt +22 -0
- data/README.md +40 -0
- data/Rakefile +34 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +284 -0
- data/coverage/assets/0.8.0/application.css +799 -0
- data/coverage/assets/0.8.0/application.js +1559 -0
- data/coverage/assets/0.8.0/colorbox/border.png +0 -0
- data/coverage/assets/0.8.0/colorbox/controls.png +0 -0
- data/coverage/assets/0.8.0/colorbox/loading.gif +0 -0
- data/coverage/assets/0.8.0/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.8.0/favicon_green.png +0 -0
- data/coverage/assets/0.8.0/favicon_red.png +0 -0
- data/coverage/assets/0.8.0/favicon_yellow.png +0 -0
- data/coverage/assets/0.8.0/loading.gif +0 -0
- data/coverage/assets/0.8.0/magnify.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +1798 -0
- data/examples/book_author.png +0 -0
- data/examples/book_author.rb +15 -0
- data/graphviz-diagram.gemspec +29 -0
- data/lib/graphviz/diagram.rb +17 -0
- data/lib/graphviz/diagram/class_diagram.rb +207 -0
- data/lib/graphviz/diagram/record_label.rb +44 -0
- data/lib/graphviz/diagram/version.rb +9 -0
- data/lib/graphviz_diagram.rb +1 -0
- data/spec/lib/graphviz/diagram/class_diagram_spec.rb +56 -0
- data/spec/lib/graphviz/diagram/record_label_spec.rb +48 -0
- data/spec/lib/graphviz/diagram_spec.rb +10 -0
- data/spec/spec_helper.rb +20 -0
- data/tags +56 -0
- metadata +206 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7b496f8c6abdef04af95d197dcf4ed28eee3b6fc
|
4
|
+
data.tar.gz: 2ecd37aaea22b3601e16f57e4328b0244128358b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7a940cc3a39c125d8e2afd89627d9e84d29b10018b57949f59bedd00e081c53abab32775448ee79b831175feb698227e02a26fd604a81e6aa1f3f1b6ea072ad8
|
7
|
+
data.tar.gz: 5359cd767a0420f90fc30bd8d34ca844493cc22487764debc4b201b8ff801af337e2586d89a4078710ff99b5c1d9f4a82ea9aad31c8c31f8bd8cf6a1a3e1ec2b
|
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
.DS_Store
|
2
|
+
.bundle
|
3
|
+
logs/*.log
|
4
|
+
logs/**/*.log
|
5
|
+
log/*.log
|
6
|
+
log/**/*.log
|
7
|
+
tmp/**/*
|
8
|
+
.sass-cache/*
|
9
|
+
*.bak
|
10
|
+
tmp/*
|
11
|
+
pkg/*
|
12
|
+
*.swp
|
13
|
+
*~
|
14
|
+
~*
|
15
|
+
.gmail_account
|
16
|
+
Thumbs.db
|
17
|
+
*/Thumbs.db
|
18
|
+
.idea/*
|
19
|
+
db/*.db
|
20
|
+
db/*.sqlite*
|
21
|
+
.yardoc/**/*
|
22
|
+
doc/coverage
|
23
|
+
Gemfile.lock
|
24
|
+
.dev_flow
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rubocop, all_on_start: false, cli: ['--format', 'clang'] do
|
5
|
+
watch(%r{^app/(.+)\.rb$})
|
6
|
+
end
|
7
|
+
|
8
|
+
guard :rspec, cmd: 'bundle exec rspec --color -f d' do
|
9
|
+
watch(%r{^spec/.+_spec\.rb$})
|
10
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^examples/(.+)\.rb$}) { |m| "spec/examples/#{m[1]}_spec.rb" }
|
12
|
+
watch('spec/spec_helper.rb') { "spec" }
|
13
|
+
|
14
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
15
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
16
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Huang Wei
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Graphviz::Diagram
|
2
|
+
|
3
|
+
A simple utility to create class-diagrams based on Graphviz.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'graphviz-diagram'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install graphviz-diagram
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Create a diagram:
|
22
|
+
|
23
|
+
g = Graphviz::Diagram.new
|
24
|
+
|
25
|
+
g['Author'].add_attribute 'name', visibility: :private, type: 'String'
|
26
|
+
g['Author'].add_attribute 'age', visibility: :private, type: 'Age'
|
27
|
+
g['Author'].add_method 'books', type: 'Array'
|
28
|
+
g['Author'].add_method 'update', arguments: 'name, age', type: 'Boolean'
|
29
|
+
|
30
|
+
g['Book'].add_attribute 'title', type: 'String'
|
31
|
+
g['Book'].add_method 'author', type: 'Author'
|
32
|
+
|
33
|
+
g << g['Book'].belongs_to(g['Author'])
|
34
|
+
g.output png: 'book_author.png'
|
35
|
+
|
36
|
+
It create a `book_author.png` file looks like:
|
37
|
+
|
38
|
+
![book_author](examples/book_author.png)
|
39
|
+
|
40
|
+
(`examples` folder contains more examples)
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake'
|
3
|
+
Dir.glob('lib/tasks/*.rake').each { |r| import r }
|
4
|
+
|
5
|
+
ENV['APP_ROOT'] = File.expand_path('../', __FILE__)
|
6
|
+
$LOAD_PATH.unshift File.join(ENV['APP_ROOT'], 'lib')
|
7
|
+
require 'graphviz_diagram'
|
8
|
+
|
9
|
+
require 'rspec/core/rake_task'
|
10
|
+
desc 'Run all (r)spec tests'
|
11
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
12
|
+
# t.spec_files = FileList[ENV['F']] if ENV['F']
|
13
|
+
t.rspec_opts = '--format documentation --color'
|
14
|
+
end
|
15
|
+
|
16
|
+
require 'rubocop/rake_task'
|
17
|
+
desc 'Run rubocop for local directory'
|
18
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
19
|
+
task.patterns = ['{app,config,lib}/**/*.rb']
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Create ctags file for vim'
|
23
|
+
task :ctags do
|
24
|
+
sh 'ctags -R --exclude=*.js .'
|
25
|
+
end
|
26
|
+
|
27
|
+
require 'pry'
|
28
|
+
desc 'invoke an interactive console'
|
29
|
+
task :console do
|
30
|
+
binding.pry
|
31
|
+
end
|
32
|
+
task :c => :console
|
33
|
+
|
34
|
+
task default: [:ctags, :rubocop, :spec]
|
@@ -0,0 +1,284 @@
|
|
1
|
+
{
|
2
|
+
"RSpec": {
|
3
|
+
"coverage": {
|
4
|
+
"/Users/huangw/working/gems/graphviz-diagram/lib/graphviz_diagram.rb": [
|
5
|
+
1
|
6
|
+
],
|
7
|
+
"/Users/huangw/working/gems/graphviz-diagram/lib/graphviz/diagram.rb": [
|
8
|
+
null,
|
9
|
+
1,
|
10
|
+
1,
|
11
|
+
1,
|
12
|
+
1,
|
13
|
+
null,
|
14
|
+
null,
|
15
|
+
1,
|
16
|
+
null,
|
17
|
+
1,
|
18
|
+
1,
|
19
|
+
2,
|
20
|
+
2,
|
21
|
+
null,
|
22
|
+
null,
|
23
|
+
null,
|
24
|
+
null
|
25
|
+
],
|
26
|
+
"/Users/huangw/working/gems/graphviz-diagram/lib/graphviz/diagram/record_label.rb": [
|
27
|
+
null,
|
28
|
+
null,
|
29
|
+
null,
|
30
|
+
1,
|
31
|
+
null,
|
32
|
+
1,
|
33
|
+
null,
|
34
|
+
1,
|
35
|
+
1,
|
36
|
+
10,
|
37
|
+
null,
|
38
|
+
null,
|
39
|
+
null,
|
40
|
+
1,
|
41
|
+
23,
|
42
|
+
23,
|
43
|
+
23,
|
44
|
+
8,
|
45
|
+
7,
|
46
|
+
1,
|
47
|
+
null,
|
48
|
+
0,
|
49
|
+
null,
|
50
|
+
null,
|
51
|
+
15,
|
52
|
+
null,
|
53
|
+
null,
|
54
|
+
null,
|
55
|
+
1,
|
56
|
+
13,
|
57
|
+
null,
|
58
|
+
null,
|
59
|
+
1,
|
60
|
+
10,
|
61
|
+
null,
|
62
|
+
null,
|
63
|
+
1,
|
64
|
+
null,
|
65
|
+
1,
|
66
|
+
23,
|
67
|
+
null,
|
68
|
+
null,
|
69
|
+
null,
|
70
|
+
null
|
71
|
+
],
|
72
|
+
"/Users/huangw/working/gems/graphviz-diagram/lib/graphviz/diagram/class_diagram.rb": [
|
73
|
+
null,
|
74
|
+
null,
|
75
|
+
null,
|
76
|
+
1,
|
77
|
+
null,
|
78
|
+
1,
|
79
|
+
null,
|
80
|
+
1,
|
81
|
+
1,
|
82
|
+
null,
|
83
|
+
null,
|
84
|
+
1,
|
85
|
+
null,
|
86
|
+
null,
|
87
|
+
null,
|
88
|
+
null,
|
89
|
+
null,
|
90
|
+
null,
|
91
|
+
null,
|
92
|
+
null,
|
93
|
+
null,
|
94
|
+
null,
|
95
|
+
1,
|
96
|
+
1,
|
97
|
+
5,
|
98
|
+
5,
|
99
|
+
null,
|
100
|
+
null,
|
101
|
+
1,
|
102
|
+
0,
|
103
|
+
null,
|
104
|
+
null,
|
105
|
+
1,
|
106
|
+
0,
|
107
|
+
null,
|
108
|
+
null,
|
109
|
+
1,
|
110
|
+
0,
|
111
|
+
null,
|
112
|
+
null,
|
113
|
+
null,
|
114
|
+
1,
|
115
|
+
0,
|
116
|
+
null,
|
117
|
+
null,
|
118
|
+
1,
|
119
|
+
6,
|
120
|
+
6,
|
121
|
+
6,
|
122
|
+
13,
|
123
|
+
13,
|
124
|
+
null,
|
125
|
+
6,
|
126
|
+
null,
|
127
|
+
null,
|
128
|
+
1,
|
129
|
+
3,
|
130
|
+
3,
|
131
|
+
3,
|
132
|
+
8,
|
133
|
+
8,
|
134
|
+
null,
|
135
|
+
3,
|
136
|
+
null,
|
137
|
+
null,
|
138
|
+
1,
|
139
|
+
1,
|
140
|
+
null,
|
141
|
+
null,
|
142
|
+
1,
|
143
|
+
2,
|
144
|
+
null,
|
145
|
+
null,
|
146
|
+
1,
|
147
|
+
0,
|
148
|
+
null,
|
149
|
+
null,
|
150
|
+
1,
|
151
|
+
0,
|
152
|
+
null,
|
153
|
+
null,
|
154
|
+
null,
|
155
|
+
1,
|
156
|
+
5,
|
157
|
+
5,
|
158
|
+
5,
|
159
|
+
5,
|
160
|
+
5,
|
161
|
+
5,
|
162
|
+
5,
|
163
|
+
null,
|
164
|
+
null,
|
165
|
+
5,
|
166
|
+
5,
|
167
|
+
1,
|
168
|
+
1,
|
169
|
+
null,
|
170
|
+
1,
|
171
|
+
1,
|
172
|
+
null,
|
173
|
+
null,
|
174
|
+
5,
|
175
|
+
null,
|
176
|
+
null,
|
177
|
+
1,
|
178
|
+
null,
|
179
|
+
1,
|
180
|
+
6,
|
181
|
+
1,
|
182
|
+
0,
|
183
|
+
0,
|
184
|
+
0,
|
185
|
+
null,
|
186
|
+
5,
|
187
|
+
null,
|
188
|
+
null,
|
189
|
+
null,
|
190
|
+
null,
|
191
|
+
null,
|
192
|
+
1,
|
193
|
+
null,
|
194
|
+
1,
|
195
|
+
null,
|
196
|
+
1,
|
197
|
+
3,
|
198
|
+
3,
|
199
|
+
null,
|
200
|
+
null,
|
201
|
+
1,
|
202
|
+
0,
|
203
|
+
null,
|
204
|
+
null,
|
205
|
+
null,
|
206
|
+
null,
|
207
|
+
1,
|
208
|
+
1,
|
209
|
+
1,
|
210
|
+
null,
|
211
|
+
null,
|
212
|
+
null,
|
213
|
+
null,
|
214
|
+
1,
|
215
|
+
1,
|
216
|
+
2,
|
217
|
+
null,
|
218
|
+
null,
|
219
|
+
null,
|
220
|
+
null,
|
221
|
+
1,
|
222
|
+
1,
|
223
|
+
0,
|
224
|
+
null,
|
225
|
+
null,
|
226
|
+
null,
|
227
|
+
null,
|
228
|
+
1,
|
229
|
+
1,
|
230
|
+
0,
|
231
|
+
null,
|
232
|
+
null,
|
233
|
+
null,
|
234
|
+
null,
|
235
|
+
1,
|
236
|
+
4,
|
237
|
+
4,
|
238
|
+
4,
|
239
|
+
4,
|
240
|
+
null,
|
241
|
+
null,
|
242
|
+
1,
|
243
|
+
7,
|
244
|
+
3,
|
245
|
+
4,
|
246
|
+
null,
|
247
|
+
0,
|
248
|
+
null,
|
249
|
+
null,
|
250
|
+
null,
|
251
|
+
1,
|
252
|
+
2,
|
253
|
+
null,
|
254
|
+
null,
|
255
|
+
1,
|
256
|
+
24,
|
257
|
+
null,
|
258
|
+
null,
|
259
|
+
null,
|
260
|
+
1,
|
261
|
+
4,
|
262
|
+
4,
|
263
|
+
null,
|
264
|
+
null,
|
265
|
+
1,
|
266
|
+
1,
|
267
|
+
4,
|
268
|
+
4,
|
269
|
+
null,
|
270
|
+
null,
|
271
|
+
1,
|
272
|
+
3,
|
273
|
+
null,
|
274
|
+
null,
|
275
|
+
1,
|
276
|
+
null,
|
277
|
+
null,
|
278
|
+
null,
|
279
|
+
null
|
280
|
+
]
|
281
|
+
},
|
282
|
+
"timestamp": 1406013003
|
283
|
+
}
|
284
|
+
}
|