gn_crossmap 3.1.2 → 3.1.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: 718319ecf3f6fb638cf74e5032f9f0a5d1291c6b
4
- data.tar.gz: ee231d6521ed912b3f970c4c96050368a83a254f
3
+ metadata.gz: dd937cc49a912ee4e7eefd2706b8050cdb34bd03
4
+ data.tar.gz: 764ad83d40ef1e9242a937d79548383483773398
5
5
  SHA512:
6
- metadata.gz: 17f08e5214cf23a8839f020c40080028fa9832a24271c266f38e45dcabc10b974e5b97d3e899a9b1e38490d6a0a8f89a5fd8d3bfb214bc6633f756520e473663
7
- data.tar.gz: 03066cffa6b464a2136d648749bfd29d00f3c03b5fd2a0fd10af5a9082f5b11c77239d22cd3693f035dc2954bd9297900fa56f3707438cb681dd3a6357043a0a
6
+ metadata.gz: ffb3cc23b36f9fe2310091b0f435f0c7f8245d7c5a9b2a26159800c3c3dbe0cd7f7871d0853ed4ae0ca378efdde4cba9891008ebfe4174b6717767fe40595cf3
7
+ data.tar.gz: 609754d18b3079bea30cdadbec424f54dd40f50e759dd8dc1cf3e11266feee7dae74d6b9512edb57d0e8979223a9b5fbf59f67807db7564596632b6533943a17
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # ``gn_crossmap`` CHANGELOG
2
2
 
3
+ ## 3.1.3
4
+
5
+ * @dimus - Fix formatting bug for empty results, remove BOM char from headers
6
+
3
7
  ## 3.1.2
4
8
 
5
9
  * @dimus - Fixes #37 tab is now default if separator is not found
@@ -26,7 +26,7 @@ module GnCrossmap
26
26
  end
27
27
 
28
28
  def prepare_field(field)
29
- field = field.to_s.tr(":", "/")
29
+ field = field.to_s.tr(":", "/").delete("\u{feff}")
30
30
  return :none if field == ""
31
31
  field.split("/")[-1].strip.downcase.to_sym
32
32
  end
@@ -30,13 +30,19 @@ module GnCrossmap
30
30
  def write_empty_result(datum)
31
31
  @stats.stats[:matches][0] += 1
32
32
  @stats.stats[:resolved_records] += 1
33
- res = @original_data[datum[:supplied_id]]
34
- res += [GnCrossmap::MATCH_TYPES[0], datum[:supplied_name_string], nil,
35
- datum[:supplied_canonical_form], nil,
36
- @input[datum[:supplied_id]][:rank], nil, nil, nil, nil]
33
+ res = compile_empty_result(datum)
37
34
  @writer.write(res)
38
35
  end
39
36
 
37
+ def compile_empty_result(datum)
38
+ res = @original_data[datum[:supplied_id]]
39
+ res += [GnCrossmap::MATCH_TYPES[0], datum[:supplied_name_string],
40
+ nil, nil, nil, nil,
41
+ @input[datum[:supplied_id]][:rank], nil, nil, nil, nil, nil]
42
+ res << nil if @with_classification
43
+ res
44
+ end
45
+
40
46
  def write_result(datum)
41
47
  collect_stats(datum)
42
48
  datum[:results].each do |result|
@@ -72,7 +78,8 @@ module GnCrossmap
72
78
 
73
79
  def canonical(name_string)
74
80
  parsed = @parser.parse(name_string)[:scientificName]
75
- parsed[:canonical].nil? || parsed[:hybrid] ? nil : parsed[:canonical]
81
+ return nil if parsed[:canonical].nil? || parsed[:hybrid]
82
+ parsed[:canonical]
76
83
  rescue StandardError
77
84
  @parser = ScientificNameParser.new
78
85
  nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Namespace module for crossmapping checklists to GN sources
4
4
  module GnCrossmap
5
- VERSION = "3.1.2"
5
+ VERSION = "3.1.3"
6
6
 
7
7
  def self.version
8
8
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gn_crossmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: biodiversity