society 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85c1eae0a8b3cb13418839814477f569457b96d7
|
4
|
+
data.tar.gz: 5a667b71fdc0747f3e7ab75b852ae639dffd94d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e7167dc8ea3ae1ef5b063ef24b3f4572f35bc47be65600fe745f7de6d61ed766bdcbeba63e37df06adee15e47799d53ef676ce4ec51a0589b807b5a76f3b807
|
7
|
+
data.tar.gz: 47e8273c30ef00d30f4e062ed3af0e356696ac9657c8e85630e32f0a8a7dbe9c04fa2e519c88bc7741ae49dbe8279e63f2c393e3f281d9b6ab4cc3daeb23a007
|
@@ -247,14 +247,17 @@
|
|
247
247
|
};
|
248
248
|
|
249
249
|
var findCluster = data.clusters ? _findCluster : function() { return 0; };
|
250
|
+
var dataKeys = Object.keys(data);
|
250
251
|
|
251
252
|
return {
|
252
|
-
nodes:
|
253
|
+
nodes: dataKeys.map(function(node, index) {
|
253
254
|
return { name: node, group: findCluster(index) };
|
254
255
|
}),
|
255
|
-
links:
|
256
|
-
var new_edges = Object.keys(data[node]).
|
257
|
-
return
|
256
|
+
links: dataKeys.reduce(function(edges, node, source) {
|
257
|
+
var new_edges = Object.keys(data[node]).filter(function(edge) {
|
258
|
+
return(Object.keys(data).indexOf(edge) != -1);
|
259
|
+
}).map(function(edge) {
|
260
|
+
return { source: source, target: dataKeys.indexOf(edge), value: data[node][edge] };
|
258
261
|
});
|
259
262
|
return(edges.concat(new_edges));
|
260
263
|
}, [])
|
data/lib/society/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: society
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coraline Ada Ehmke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project:
|
242
|
-
rubygems_version: 2.
|
242
|
+
rubygems_version: 2.4.6
|
243
243
|
signing_key:
|
244
244
|
specification_version: 4
|
245
245
|
summary: Social graph for Ruby objects
|
@@ -251,3 +251,4 @@ test_files:
|
|
251
251
|
- spec/object_graph_spec.rb
|
252
252
|
- spec/parser_spec.rb
|
253
253
|
- spec/spec_helper.rb
|
254
|
+
has_rdoc:
|