family-reunion 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.2.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{family-reunion}
8
- s.version = "0.1.7"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dmitry Mozzherin", "David Shorthouse"]
@@ -27,11 +27,23 @@ class FamilyReunion
27
27
  # Homonyms are treated separately, and are not matched by the algorithm,
28
28
  # they are excluded from valid_matches
29
29
  valid_matches.each do |name|
30
- primary_id = @fr.primary_node.valid_names_hash[name][:id].to_s.to_sym
31
- path = @fr.primary_node.valid_names_hash[name][:path]
32
- path_ids = @fr.primary_node.valid_names_hash[name][:path_ids]
33
- secondary_id = @fr.secondary_node.valid_names_hash[name][:id].to_s.to_sym
34
- @fr.merges[primary_id] = {:matches => {secondary_id => {:merge_type => :exact_valid_to_valid, :path => path, :path_ids => path_ids }}, :nonmatches => {}}
30
+ pn = @fr.primary_node.valid_names_hash[:name]
31
+ sn = @fr.secondary_node.valid_names_hash[:name]
32
+ primary_id = pn[:id].to_s.to_sym
33
+ primary_path = pn[:path]
34
+ primary_path_ids = pn[:path_ids]
35
+ secondary_id = sn[:id].to_s.to_sym
36
+ secondary_path = sn[:path]
37
+ secondary_path_ids = sn[:path_ids]
38
+ @fr.merges[primary_id] = {
39
+ :path => primary_path,
40
+ :path_ids => primary_path_ids,
41
+ :matches => {secondary_id => {
42
+ :merge_type => :exact_valid_to_valid,
43
+ :path => secondary_path,
44
+ :path_ids => secondary_path_ids}},
45
+ :nonmatches => {}
46
+ }
35
47
  end
36
48
  end
37
49
 
@@ -6,7 +6,7 @@ class FamilyReunion
6
6
  raise "Secondary id is not a symbol" unless i.is_a?(Symbol)
7
7
  path = @fr.secondary_node.ids_hash[i][:path]
8
8
  path_ids = @fr.secondary_node.ids_hash[i][:path_ids]
9
- res[i] = {:merge_type => merge_type, :path => path, :path_ids => path_ids} unless res.has_key?(i)
9
+ res[i] = { :merge_type => merge_type, :path => path, :path_ids => path_ids } unless res.has_key?(i)
10
10
  res
11
11
  end
12
12
  end
@@ -18,7 +18,9 @@ class FamilyReunion
18
18
  @fr.merges[primary_id][:matches][key] = val unless @fr.merges[primary_id][:matches].has_key?(key)
19
19
  end
20
20
  else
21
- @fr.merges[primary_id] = {:matches => secondary_id_matches, :nonmatches => {}}
21
+ path = @fr.primary_node.ids_hash[i][:path]
22
+ path_ids = @fr.primary_node.ids_hash[i][:path_ids]
23
+ @fr.merges[primary_id] = { :path => path, :path_ids => path_ids, :matches => secondary_id_matches, :nonmatches => {} }
22
24
  end
23
25
  end
24
26
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 7
9
- version: 0.1.7
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dmitry Mozzherin
@@ -233,7 +233,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - ">="
235
235
  - !ruby/object:Gem::Version
236
- hash: -1909949291295368264
236
+ hash: -402388446761307485
237
237
  segments:
238
238
  - 0
239
239
  version: "0"