depvizdoc 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 29e261e87bd424b7ec2871f2e994a024e19143a3
4
+ data.tar.gz: b80553f2ed0e5ce2d4cd5a9b00c53a52e1d0f940
5
+ SHA512:
6
+ metadata.gz: e197db2cd8d3af5cf4f68305741c3494ca91e13afb2032a3fe7578d07a4119fca90ddbd3662c4e6fde6479fe9a10a3288db6d24463c3c7ac36e274868eff0899
7
+ data.tar.gz: 05674ab3bb5f1ba314c69aac08c731f854e298f6d72b9a7340d6f8a36025685d922e638057cbe3f518d76a68322a881416550cc7a9586baee6e6c4ed474ddb7d
checksums.yaml.gz.sig ADDED
Binary file
data/lib/depvizdoc.rb ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: depvizdoc.rb
4
+
5
+
6
+ require 'depviz'
7
+ require 'martile'
8
+ require 'rdiscount'
9
+
10
+
11
+ class DepVizDoc < DepViz
12
+
13
+ def initialize(s='', root: 'platform',
14
+ style: default_stylesheet(), path: '.')
15
+
16
+ @style, @root = style, root
17
+ @header = "
18
+ <?polyrex schema='items[type]/item[label, url]' delimiter =' # '?>
19
+ type: digraph
20
+
21
+ "
22
+
23
+ return if s.empty?
24
+
25
+ @s = tree = DependencyBuilder.new(s).to_s
26
+
27
+ s2 = tree.lines.map do |line|
28
+ x = line.chomp
29
+ "%s # %s.html" % [x, x[/\w+$/]]
30
+ end.join("\n")
31
+
32
+
33
+ s = root ? (root + "\n" + s2.lines.map {|x| ' ' + x}.join) : s2
34
+
35
+ @pxg = PxGraphViz.new(@header + s, style: style)
36
+
37
+ # generate each HTML file
38
+ items = tree.lines.flatten.map {|x| x.chomp.lstrip }.uniq
39
+
40
+ FileUtils.mkdir_p File.join(path, 'svg')
41
+
42
+ items.each do |item|
43
+
44
+ # generate the dependency chart
45
+ File.write File.join(path, 'svg', item + '_dep.svg'),
46
+ self.item(item).dependencies.to_svg
47
+
48
+ rdep = self.item(item).reverse_dependencies
49
+ # generate the reverse dependency chart
50
+
51
+ if rdep then
52
+ File.write File.join(path, 'svg', item + '_rdep.svg'), rdep.to_svg
53
+ end
54
+
55
+ md = "
56
+ # #{item}
57
+
58
+ ## Dependencies
59
+
60
+ ![](#{File.join(path, 'svg', item + '_dep.svg')})
61
+
62
+ ## Reverse dependencies
63
+
64
+ "
65
+
66
+ md << if rdep then
67
+ "![](%s)" % File.join(path, 'svg', item + '_rdep.svg')
68
+ else
69
+ 'none'
70
+ end
71
+
72
+ html = RDiscount.new(Martile.new(md).to_s).to_html
73
+ File.write File.join(item + '.html'), html
74
+
75
+ end
76
+
77
+ end
78
+
79
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: depvizdoc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
+ YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMTI0MTM1NTA3WhcN
15
+ MTkwMTI0MTM1NTA3WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
+ cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC5Y9ia
17
+ NYNvhjIdO81fglRXBqUryLmPtsAko+QAxUQF/QVlYWHHnfgY486HVNZ7J5TmHXHD
18
+ 2uXMCWEuzyfCIwSYEwpWeKa8Cl0d7wr0CFWEqINB0uYL18Det42xZEnCYFjSOwIO
19
+ //09wqAdxFIQLK2M6BuYOja3jQL/tlW1FuJxo6V4LQK/b2/VKxJahlWbUs2w0coB
20
+ nvRKWzLQIVvdACjdBCx+AnfFACXGhqM+0Xq0+pNxIPoaZVkjSVn97zW5UUbv4GrK
21
+ mDWnB2sDnoGSYe70iAwT4ubIepbKtUdd0Tb2ZgElKhIkJONdkyZEiYOwWoQQB3AT
22
+ 3AcEPidc8mcUjc1fAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
+ HQYDVR0OBBYEFBYhdmiCyFlkrvtIc9OwBroKfXFYMCYGA1UdEQQfMB2BG2dlbW1h
24
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
+ ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBACCinLSV1cq0BGbNuhoZ
26
+ osDl1/tWTHmLxR4GZh9rt2wwxmpxCE3YZK5t4/lGM2IOb8S6Duj3sRpruZJlbJt3
27
+ KoS+3AZarM2ZKcyBNspuw8IJQod7mWkyFD6UEfw1oARUhQT33bKFa3fJDCCzs+US
28
+ zXr1gHFqNAoT3DkMubCNZkDb3yTNNym9mKEtNO2U6KOqKdW9iJsQL1pRk9/AU8Tn
29
+ gNagpM2lunT23CEXaGQHDQulgVH8tNj8MkTnb+XGldxqR0UJoAIUl4qP3qFvA7KU
30
+ AsyxqBwDyOo67W9OJZPTaZD/g0i6Ibl1nxiQmadwlpMPiW7PpPOtOAidFz7aRiOO
31
+ Ifw=
32
+ -----END CERTIFICATE-----
33
+ date: 2018-01-24 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: depviz
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.3'
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 0.3.1
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '0.3'
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.3.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: martile
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.8.1
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0.8'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.8.1
75
+ description:
76
+ email: james@jamesrobertson.eu
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files: []
80
+ files:
81
+ - lib/depvizdoc.rb
82
+ homepage: https://github.com/jrobertson/depvizdoc
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.6.13
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Generates a hyperlinked SVG document containing relative dependencies for
106
+ all the given dependecies.
107
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ ��t��U�>T�}�$k]:�s�:�o��wv����)
2
+ 3WO�aZ5 �[�|���u6$x��y�*��?�*Ǐ�[˭#'<�݃|U#f�೰<#���൸����uA. ���+^�7�5�'�r�e7H