yard-medoosa 0.0.1 → 0.0.2
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
- data/lib/yard/medoosa.rb +14 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77ffa21f3f8b3ddc28c3b252587f6ea81d3fa5c04fccd5fda3c84d316ef1dd7b
|
4
|
+
data.tar.gz: bc3e447eb8048d476c459b2a9bf02628c6639d015eed8fbe1e9189f7b64e358d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04da1787024e659552d80b2e0e1c26287f6fd6cacd55ad36f57212d57c72ea3f84c588f2d8171abd120b0f765e6fe71cb4e6287a6ec53b3c10e328317747b357
|
7
|
+
data.tar.gz: 24b1966d39668293554a9771ee1c7754ad8671e9bce67688c9c4bf8ffb1baed7442c86663def1cdc6ea9536208529b061035773886c8462a1affd57e9a2f8471
|
data/lib/yard/medoosa.rb
CHANGED
@@ -18,23 +18,18 @@ module YARD
|
|
18
18
|
# @param all_nodes [Hash{String => Graphviz::Node}] (filled by the method)
|
19
19
|
# @param namespace [YARD::CodeObjects::NamespaceObject]
|
20
20
|
def add_clusters(graph, all_nodes, namespace)
|
21
|
+
href = namespace.path.gsub("::", "/") + ".html"
|
22
|
+
n = graph.add_node(namespace.path,
|
23
|
+
label: namespace.name, shape: "box", href: href)
|
24
|
+
all_nodes[namespace.path] = n
|
21
25
|
children = module_children(namespace)
|
22
|
-
if children.empty?
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
sg = graph
|
30
|
-
else
|
31
|
-
sg = graph.add_subgraph(cluster: true)
|
32
|
-
sg.attributes[:name] = namespace.path
|
33
|
-
sg.attributes[:label] = namespace.name
|
34
|
-
end
|
35
|
-
children.each do |c|
|
36
|
-
add_clusters(sg, all_nodes, c)
|
37
|
-
end
|
26
|
+
return if children.empty?
|
27
|
+
|
28
|
+
sg = graph.add_subgraph(cluster: true)
|
29
|
+
sg.attributes[:name] = namespace.path
|
30
|
+
sg.attributes[:label] = namespace.name
|
31
|
+
children.each do |c|
|
32
|
+
add_clusters(sg, all_nodes, c)
|
38
33
|
end
|
39
34
|
end
|
40
35
|
|
@@ -44,7 +39,9 @@ module YARD
|
|
44
39
|
|
45
40
|
g = Graphviz::Graph.new
|
46
41
|
all_nodes = {}
|
47
|
-
|
42
|
+
module_children(YARD::Registry.root).each do |ns_object|
|
43
|
+
add_clusters(g, all_nodes, ns_object)
|
44
|
+
end
|
48
45
|
|
49
46
|
YARD::Registry.all(:class).each do |code_object|
|
50
47
|
sup = YARD::Registry.resolve(nil, code_object.superclass)
|