universe_compiler 0.3.0 → 0.3.1

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: 74a3ec7f9f7eabc456f265d047bf92492039fd8f
4
- data.tar.gz: af3c07e4b7be608ec614de02fa5200a8a305e236
3
+ metadata.gz: da014c3e9cc37f1f99bbedb67688c7dbbe5a91e4
4
+ data.tar.gz: d2cffc16ba1d162ba824861ecf44b4f9a05d4dde
5
5
  SHA512:
6
- metadata.gz: 551eb041d06b5fb15dac1a4ef75574e98a9315c1e27f75c1ea88843ebca171271b1a20a531b84a6fa54cb22e732be3aa94d4ec4f8a5879b06aa964a6cd9b2876
7
- data.tar.gz: 06e25e42a45c83d3a7bca5f10b9c12c11ffe7e20de257f0b70b8b086fdef3e258d9a80780821555b3e052cc7a72aebcec2b16e1d90d70117b88d8c30c15526bd
6
+ metadata.gz: 2b566f2070273cbecb289d6023bab4fd8ac968db544095a580cf3ba1fafbc55926e22efed42726abc454c9937737aba901696679ca3058234d0836c78c463e19
7
+ data.tar.gz: 92c74c7f20d6bf36c5227ef7279467fb655f9c82e4b117ad62403d1cdb423782c8bc3698250eef489cfa1d9404b52afb7a6998baa935cc920c2c7ae952d292ff
@@ -22,7 +22,7 @@ module UniverseCompiler
22
22
  cache[:by_entity][entity] = node
23
23
  cache[:by_node][node] = entity
24
24
  end
25
-
25
+
26
26
  # Building relations
27
27
  entities.each do |entity|
28
28
  entity.class.fields_constraints.each do |field_name, field_constraints|
@@ -30,10 +30,10 @@ module UniverseCompiler
30
30
  case constraint_name
31
31
  when :has_one
32
32
  target = entity[field_name]
33
- g.add_edges cache[:by_entity][entity], cache[:by_entity][target] unless target.nil?
33
+ g.add_edges cache[:by_entity][entity], cache[:by_entity][target] unless entities.include? target
34
34
  when :has_many
35
35
  entity[field_name].each do |target|
36
- g.add_edges cache[:by_entity][entity], cache[:by_entity][target]
36
+ g.add_edges cache[:by_entity][entity], cache[:by_entity][target] unless entities.include? target
37
37
  end
38
38
  end
39
39
  end
@@ -55,17 +55,17 @@ module UniverseCompiler
55
55
  file_ext = (file_ext.start_with? '.') ? file_ext : ".#{file_ext}"
56
56
 
57
57
  output_file_name = case output_file_name
58
- when NilClass
59
- file = Tempfile.create ['entities_graph', file_ext]
60
- file.close
61
- file.path
62
- when String
63
- if output_file_name.end_with? file_ext
64
- output_file_name
65
- else
66
- "#{output_file_name}#{file_ext}"
67
- end
68
- end
58
+ when NilClass
59
+ file = Tempfile.create ['entities_graph', file_ext]
60
+ file.close
61
+ file.path
62
+ when String
63
+ if output_file_name.end_with? file_ext
64
+ output_file_name
65
+ else
66
+ "#{output_file_name}#{file_ext}"
67
+ end
68
+ end
69
69
 
70
70
  if generate_file
71
71
  g.output( file_type => output_file_name )
@@ -1,3 +1,3 @@
1
1
  module UniverseCompiler
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universe_compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent B.