macrocosm 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/macrocosm/version.rb +1 -1
- data/lib/macrocosm.rb +2 -2
- 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: 4e69ec0db56b0ec932ab3578ab04f0c587327b4b9722746179a1b2e57e54653c
|
4
|
+
data.tar.gz: e23c4c4907c678ee1e22b665a842235d6c59d2596f3aa3a3a0b9f4d8878685bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2451dfd40be9647ee4369eecc0e9a5480763a9bfb06e8598a680aea22aa013649ca004271828fc000add6d129f92745d024162d3c1092b93c7045311d7e1c0
|
7
|
+
data.tar.gz: ea2b6f1aacca148b9758d20b3d1314f367a7b52aa1b601fcfa761c69579d3332c60ad097d35bb3c6ea6d9175e50bc3035d4687384cee1afa0f438bdfce0b1fbb
|
data/lib/macrocosm/version.rb
CHANGED
data/lib/macrocosm.rb
CHANGED
@@ -18,7 +18,7 @@ class Macrocosm
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def add_node(name, category = nil)
|
21
|
-
category
|
21
|
+
category = (category || NoCategory).to_s
|
22
22
|
idx = @categories[category]
|
23
23
|
@nodes << {
|
24
24
|
name: name,
|
@@ -47,7 +47,7 @@ class Macrocosm
|
|
47
47
|
JSON.pretty_generate({
|
48
48
|
nodes: @nodes,
|
49
49
|
links: @links,
|
50
|
-
categories: @categories.keys.map{ |name| {name: name} }
|
50
|
+
categories: @categories.keys.sort!.map{ |name| {name: name} }
|
51
51
|
})
|
52
52
|
end
|
53
53
|
|