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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yard/medoosa.rb +14 -17
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a9aafb3def317dbf7e7f5259184d680c5f32b582f84d4c6ee93780b124b330f
4
- data.tar.gz: 5ad2dc042c73e4f978fd5fce7d96cf8617ffb8580da6f2a0c19ae09d82796621
3
+ metadata.gz: 77ffa21f3f8b3ddc28c3b252587f6ea81d3fa5c04fccd5fda3c84d316ef1dd7b
4
+ data.tar.gz: bc3e447eb8048d476c459b2a9bf02628c6639d015eed8fbe1e9189f7b64e358d
5
5
  SHA512:
6
- metadata.gz: 2f9cb843b309cb15f360ce9ae088b4bfd71207ce53516579d1e7f5b2e2b8c829ec65a147fbea7c7d85458e8b6db00bb244d30c9f669d463ddc4d5f9a62f6ea15
7
- data.tar.gz: ddbca4431c1d454d161c1746a4e96c7b9a4a3acbb854afe7d85ccc66909f2ed1e4d53295d032cd2098977baaf9598f3ed9607c6b93f76471d3adea0d84085925
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
- href = namespace.path.gsub("::", "/") + ".html"
24
- n = graph.add_node(namespace.path,
25
- label: namespace.name, shape: "box", href: href)
26
- all_nodes[namespace.path] = n
27
- else
28
- if namespace.is_a? YARD::CodeObjects::RootObject
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
- add_clusters(g, all_nodes, YARD::Registry.root)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-medoosa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Vidner