depviz 0.5.2 → 0.5.3
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/depviz.rb +69 -69
- data.tar.gz.sig +0 -0
- metadata +26 -25
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bea5e848933306a1774c6d5359f9129249c1c1eabae2e17a2272e25deba7014
|
4
|
+
data.tar.gz: e6a5bb5267bf93e7c38532538b4c98d3dbe437a3a17f6b1146ad682fae40f6af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6682223bb805da84b4d4e639bdbb0cebce966a1f9b46f7b27395fa40aeab5e18536e5101aead00919a765aad58af19de6e060bf44091b1ca70ad266b943851eb
|
7
|
+
data.tar.gz: 6d2ae657451b3523ff329e3af5f653027da64d14d1924fa278576326e5af7abd0ff844ee56bc9775f81eb3edc845a957e4ede37bdae70c2767406a01d1dee5f3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/depviz.rb
CHANGED
@@ -18,49 +18,49 @@ hkey_gems
|
|
18
18
|
require depviz
|
19
19
|
class DepViz
|
20
20
|
media_type svg
|
21
|
-
'
|
21
|
+
'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
class DepViz < PxGraphViz
|
26
26
|
using ColouredText
|
27
|
-
|
27
|
+
|
28
28
|
class Item
|
29
|
-
|
30
|
-
def initialize(s, root: nil, name:
|
29
|
+
|
30
|
+
def initialize(s, root: nil, name: nil, debug: false)
|
31
31
|
@s, @root, @name, @debug = s, root, name, debug
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def dependencies()
|
35
|
-
|
35
|
+
|
36
36
|
if @debug then
|
37
37
|
puts 'inside DepViz::Item::dependencies'
|
38
38
|
puts '@s: ' + @s.inspect
|
39
39
|
puts '@root: ' + @root.inspect
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
a = LineTree.new(@s).to_doc.root.xpath('//' + @name)
|
43
43
|
puts 'dep: a: ' + a.inspect if @debug
|
44
|
-
|
44
|
+
|
45
45
|
enclose = ->(a) do
|
46
46
|
a.length > 1 ? [a.first] << enclose.call(a[1..-1]) : a
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
a2 = a.map do |x|
|
50
50
|
puts ' dependencies x: ' + x.inspect if @debug
|
51
51
|
enclose.call x.backtrack.to_s.split('/')[1..-1]
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
puts 'a2: ' + a2.inspect if @debug
|
55
|
-
|
55
|
+
|
56
56
|
# group the items in order to merge branches with the same parent
|
57
57
|
a3 = a2.group_by(&:first)
|
58
|
-
a4 = a3.map {|x| [x.first] + x.last.map(&:last)}
|
59
|
-
|
58
|
+
a4 = a3.map {|x| [x.first] + x.last.map(&:last)}
|
59
|
+
|
60
60
|
treeize = ->(obj, indent=-2) do
|
61
61
|
|
62
62
|
if obj.is_a? Array then
|
63
|
-
|
63
|
+
|
64
64
|
r = obj.map {|x| treeize.call(x, indent+1)}.join("\n")
|
65
65
|
puts 'r: ' + r.inspect if @debug
|
66
66
|
r
|
@@ -70,18 +70,18 @@ class DepViz < PxGraphViz
|
|
70
70
|
' ' * indent + obj
|
71
71
|
|
72
72
|
end
|
73
|
-
end
|
74
|
-
|
73
|
+
end
|
74
|
+
|
75
75
|
s = treeize.call(a4)
|
76
|
-
|
76
|
+
|
77
77
|
puts 'child s: ' + s.inspect if @debug
|
78
78
|
|
79
79
|
dv3 = DepViz.new()
|
80
80
|
dv3.read s
|
81
81
|
dv3
|
82
|
-
|
82
|
+
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
# returns a DepViz document
|
86
86
|
#
|
87
87
|
def reverse_dependencies()
|
@@ -92,104 +92,104 @@ class DepViz < PxGraphViz
|
|
92
92
|
.map{|x| XmlToSliml.new(x).to_s }.join("\n")
|
93
93
|
|
94
94
|
return DepViz.new if s.empty?
|
95
|
-
|
95
|
+
|
96
96
|
dv3 = DepViz.new(root: nil)
|
97
97
|
dv3.read s
|
98
98
|
dv3
|
99
|
-
|
100
|
-
end
|
101
|
-
|
102
|
-
end
|
103
|
-
|
104
|
-
def initialize(s='', fields: %w(label shape), delimiter: ' # ',
|
105
|
-
root: 'platform', style: nil,
|
106
|
-
debug: false, fill: '#ccffcc', stroke: '#999999',
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
def initialize(s='', fields: %w(label shape), delimiter: ' # ',
|
105
|
+
root: 'platform', style: nil,
|
106
|
+
debug: false, fill: '#ccffcc', stroke: '#999999',
|
107
107
|
text_color: '#330055')
|
108
|
-
|
108
|
+
|
109
109
|
@style, @root, @debug = style, root, debug
|
110
110
|
@header = "
|
111
111
|
<?polyrex schema='items[type]/item[label]' delimiter =' # '?>
|
112
112
|
type: digraph
|
113
113
|
|
114
114
|
"
|
115
|
-
if s.length > 0 then
|
116
|
-
|
115
|
+
if s.length > 0 then
|
116
|
+
|
117
117
|
if s =~ /<?depviz / then
|
118
|
-
|
118
|
+
|
119
119
|
raw_dv = s.clone
|
120
120
|
s2 = raw_dv.slice!(/<\?depviz [^>]+\?>/)
|
121
121
|
|
122
122
|
# attributes being sought => root fields delimiter id
|
123
|
-
attributes = Shellwords::shellwords(s).map {|x| key,
|
123
|
+
attributes = Shellwords::shellwords(s).map {|x| key,
|
124
124
|
value = x.split(/=/, 2); [key.to_sym, value]}.to_h
|
125
|
-
|
125
|
+
|
126
126
|
h = {
|
127
|
-
fields: fields.join(', '),
|
127
|
+
fields: fields.join(', '),
|
128
128
|
delimiter: delimiter
|
129
|
-
}.merge attributes
|
129
|
+
}.merge attributes
|
130
130
|
|
131
131
|
s = if h[:root] then
|
132
|
-
"\n\n" + h[:root] + "\n" +
|
132
|
+
"\n\n" + h[:root] + "\n" +
|
133
133
|
raw_dv.strip.lines.map {|line| ' ' + line}.join
|
134
134
|
else
|
135
135
|
raw_dv
|
136
136
|
end
|
137
|
-
|
137
|
+
|
138
138
|
delimiter = h[:delimiter]
|
139
139
|
fields = h[:fields].split(/ *, */)
|
140
140
|
|
141
|
-
end
|
142
|
-
|
143
|
-
@s = tree = DependencyBuilder.new(s).to_s
|
141
|
+
end
|
142
|
+
|
143
|
+
@s = tree = DependencyBuilder.new(s).to_s
|
144
144
|
s3 = @root ? (@root + "\n" + tree.lines.map {|x| ' ' + x}.join) : tree
|
145
|
-
@pxg = super(@header + s3, style: @style)
|
146
|
-
|
145
|
+
@pxg = super(@header + s3, style: @style)
|
146
|
+
|
147
147
|
end
|
148
|
-
|
148
|
+
|
149
149
|
|
150
150
|
end
|
151
|
-
|
151
|
+
|
152
152
|
def count()
|
153
153
|
return 0 unless @s
|
154
154
|
child_nodes.length
|
155
155
|
end
|
156
|
-
|
156
|
+
|
157
157
|
def item(name)
|
158
|
-
|
158
|
+
|
159
159
|
puts 'inside DepViz::item for ' + name.inspect if @debug
|
160
160
|
puts '_@s : ' + @s.inspect if @debug
|
161
161
|
Item.new @s, root: @root, name: name, debug: @debug
|
162
|
-
|
162
|
+
|
163
163
|
end
|
164
|
-
|
164
|
+
|
165
165
|
def nodes()
|
166
|
-
|
166
|
+
|
167
167
|
child_nodes.map {|x| x.name}.uniq
|
168
|
-
|
168
|
+
|
169
169
|
end
|
170
|
-
|
170
|
+
|
171
171
|
def read(s)
|
172
|
-
|
172
|
+
|
173
173
|
@s = s
|
174
174
|
s2 = @root ? @root + "\n" + s.lines.map {|x| ' ' + x}.join : s
|
175
175
|
@pxg = PxGraphViz.new(@header + s2, style: @style)
|
176
|
-
|
176
|
+
|
177
177
|
end
|
178
|
-
|
178
|
+
|
179
179
|
def to_doc()
|
180
180
|
Rexle.new(LineTree.new(@s, root: @root).to_xml).root.elements.first
|
181
181
|
end
|
182
182
|
|
183
183
|
def to_s()
|
184
184
|
@s
|
185
|
-
end
|
185
|
+
end
|
186
186
|
|
187
187
|
def to_xml()
|
188
188
|
to_doc.xml
|
189
|
-
end
|
189
|
+
end
|
190
190
|
|
191
191
|
private
|
192
|
-
|
192
|
+
|
193
193
|
def child_nodes()
|
194
194
|
to_doc.root.xpath('//*')
|
195
195
|
end
|
@@ -197,27 +197,27 @@ type: digraph
|
|
197
197
|
def default_stylesheet()
|
198
198
|
|
199
199
|
<<STYLE
|
200
|
-
node {
|
201
|
-
color: #ddaa66;
|
200
|
+
node {
|
201
|
+
color: #ddaa66;
|
202
202
|
fillcolor: #447722;
|
203
|
-
fontcolor: #ffeecc;
|
203
|
+
fontcolor: #ffeecc;
|
204
204
|
fontname: 'Trebuchet MS';
|
205
|
-
fontsize: 10;
|
205
|
+
fontsize: 10;
|
206
206
|
margin: 0.1;
|
207
|
-
penwidth: 1.3;
|
207
|
+
penwidth: 1.3;
|
208
208
|
style: filled;
|
209
209
|
}
|
210
|
-
|
210
|
+
|
211
211
|
a node {
|
212
|
-
color: #0011ee;
|
212
|
+
color: #0011ee;
|
213
213
|
}
|
214
214
|
|
215
215
|
edge {
|
216
216
|
arrowsize: 0.9;
|
217
|
-
color: #666;
|
218
|
-
fontcolor: #444444;
|
219
|
-
fontname: Verdana;
|
220
|
-
fontsize: 8;
|
217
|
+
color: #666;
|
218
|
+
fontcolor: #444444;
|
219
|
+
fontname: Verdana;
|
220
|
+
fontsize: 8;
|
221
221
|
dir: forward;
|
222
222
|
weight: 1;
|
223
223
|
}
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: depviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -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MEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUKYwVgC2R
|
26
|
+
3zCOc27gpnSm5WkG/ucwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
27
|
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAS2Rq49RGwtcxjN9jto0LK5Pi/9F/T8fOaA6mS+Jm
|
29
|
+
TpIOGZppcqy/c9S7+duS0boopB0wy6WKgcrBFl7sMzvhY8HsC+1IvfK/OrEnGf5E
|
30
|
+
RKb+gj1LHMLNDDDjmR49hxr4HC5q0xdQjNROKecJK/9pd26FEzh83h91/y4eTDHB
|
31
|
+
R+CoV+XxQQZsaM7ob0/XXo6CLNVfexXZjaVmLb/hte8h2TsjB8ACyBE5aOPHlTqk
|
32
|
+
Q2N93GgIEx7mTTkmp0GbDx3+C5CCYTAaDzl37blfWJor24FhhKVZwSeIb0BEJDmZ
|
33
|
+
4FZeY1kID07JzDljwH+svLG4pYTOxSj0EVmiKKvVNKmHr4vDxovt/MJvRfEcTKic
|
34
|
+
zTKnpkkAKBz5bx1IPHZNy3lDcizHKyyM9NpqnhahDLay2bvPziCTFZ4TSUTY1+uT
|
35
|
+
OtP+/rSpQ79ezyeNwN9qKx23SWrNBvMkeNyMBMDdoNL+vA/sRwmiKuaWJuqIVaay
|
36
|
+
B7KTOXvQC2+5guaFLzsIiU9w
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2021-12-09 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: pxgraphviz
|
@@ -123,7 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.7.10
|
127
128
|
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: Generates a complete dependency tree from disparate dependencies to an SVG
|
metadata.gz.sig
CHANGED
Binary file
|