gn_list_resolver 3.2.0.3 → 3.2.0.4

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: f926c33ac22edb678ce33830dcbb67f024feb0fd
4
- data.tar.gz: 746879e697fc1d50f9edd74c8f09358066be4aa0
3
+ metadata.gz: f990bf592ce702c16e20f45e3c881e7f4f4df01c
4
+ data.tar.gz: e8b55f1f5e6b27e4b8eddb8e21c65ce900ede729
5
5
  SHA512:
6
- metadata.gz: 6583de51beb9a6ea7225a972facb6806dbeca4a5b5972f93c39c708ee0b0a8db9fe6095f83e538ba7b9a144d34e8ab0b568ef1c43a950c2c7d8823fc566d0533
7
- data.tar.gz: da5fcd76e92e40a1546ca23a48c0be84b94f8c463d25e112118b2c75e266fe7c65761653ed8e6cd3cebeb9b2f6bdeb667524693bb1e556b75d9c99614599d2a5
6
+ metadata.gz: c5586d503371d99d8e26cf26057e95805a5fc22ca6f2073eb4baabe31891a68ccd20b64958f1d8e6947a2ea6469c5e03981e3b514cc1696323809c03892c1f27
7
+ data.tar.gz: 44a2e55c363de3858449f0ea954e21ea4cdaf27d30c32a4d12c7d3064c9c69cb98b65fffcdab1261a86d25a01c02cffbc970a11e1909be20120c33749da66470
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # ``gn_list_resolver`` CHANGELOG
2
2
 
3
- ## 3.2.0.2
3
+ ## 3.2.0.4
4
+
5
+ @dimus - make it possible for result.canonical to be nil
6
+
7
+ ## 3.2.0.3
4
8
 
5
9
  @dimus - bring tests in accordance to changes in gnindex database
6
10
 
@@ -68,7 +68,7 @@ module GnListResolver
68
68
  def prepare_data(datum, result, match_size)
69
69
  res = [MATCH_TYPES[result.match_type.kind.to_sym], match_size,
70
70
  datum.supplied_input, result.name.value,
71
- canonical(datum.supplied_input), result.canonical_name.value,
71
+ canonical(datum.supplied_input), result_canonical(result),
72
72
  result.match_type.edit_distance, @input[datum.supplied_id][:rank],
73
73
  matched_rank(result), result.synonym, current_name(result),
74
74
  result.score.value ? result.score.value.round(3) : nil,
@@ -87,6 +87,11 @@ module GnListResolver
87
87
  end
88
88
  end
89
89
 
90
+ def result_canonical(result)
91
+ return nil unless result.canonical_name
92
+ result.canonical_name.value
93
+ end
94
+
90
95
  def canonical(name_string)
91
96
  parsed = @parser.parse(name_string)[:scientificName]
92
97
  return nil if parsed[:canonical].nil? || parsed[:hybrid]
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Namespace module for crossmapping checklists to GN sources
4
4
  module GnListResolver
5
- VERSION = "3.2.0.3"
5
+ VERSION = "3.2.0.4"
6
6
 
7
7
  def self.version
8
8
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gn_list_resolver
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.3
4
+ version: 3.2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-09-06 00:00:00.000000000 Z
12
+ date: 2017-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: biodiversity