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: 3f5c00db79f48e303c9761c55ddff13f63f8b98d
4
- data.tar.gz: a3481f185ffa41a33556755859313594f93193b1
3
+ metadata.gz: 85c1eae0a8b3cb13418839814477f569457b96d7
4
+ data.tar.gz: 5a667b71fdc0747f3e7ab75b852ae639dffd94d9
5
5
  SHA512:
6
- metadata.gz: a43aebbacd63dee2ba79115243d6e3edf935885cbccd8ad2c4c788f9518a37bc9dbed57db3b0a715017cf9a8d4db62f3f7e0be59fe77406c194549d2ceca5b3e
7
- data.tar.gz: 545c93a4a62180da519c008985787281155f98b04398f125892bc8b242a4bcfb340e21c37ac672128bd4769f50d7db9c5cb37c89712916791052a073649d1ab2
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: Object.keys(data).map(function(node, index) {
253
+ nodes: dataKeys.map(function(node, index) {
253
254
  return { name: node, group: findCluster(index) };
254
255
  }),
255
- links: Object.keys(data).reduce(function(edges, node, source) {
256
- var new_edges = Object.keys(data[node]).map(function(edge, target) {
257
- return { source: source, target: target, value: data[node][edge] };
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
  }, [])
@@ -1,3 +1,3 @@
1
1
  module Society
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
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.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-03-12 00:00:00.000000000 Z
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.2.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: