biodiversity 5.3.0 → 5.3.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
  SHA256:
3
- metadata.gz: 21aca2b78bc54f22390a57dbdef3550beeb2eb65e3407e8d4a518fedd62d23bf
4
- data.tar.gz: 8a08979ecb6f77b99928966ed1aaaec34a12048e22effd3c5924a2b6b1820317
3
+ metadata.gz: 39d4d3753604b4ec5141a9d9425eefc4f07d671d7aeb6dd28d05481821218f85
4
+ data.tar.gz: 91cc30f4dc1efa44af6bf17992fd59f2b3f11c6856c1cb830f910184a16585ee
5
5
  SHA512:
6
- metadata.gz: a308d0af1aadb91ca19402bd61c4933da3555f774f78f4c6c1f9313ea150cf6f62f06c9245f01abaa832a8db5d102961a78e67b2e4e53f44c3110de21ff3c124
7
- data.tar.gz: 122f7b88eae3c8fe9f4943f49b6bbca6ee46bad15687d65725a88d8e01823b56d8ec7792973d19236bfb67d3f37756a5b88a565a26c863949c845ac6a5aba782
6
+ metadata.gz: 87156cd1064fc9ea20a58044b48a2ae98a9e5da04e4ac1cfde0d1124d522dfba86399bb87a2d88fdeb4fb7da7d82776fd2d5656857e56578aaf3cd6b3c229bee
7
+ data.tar.gz: ec24a9460b0a13860dc287f73578f4ee81f4effd514e3238c16d2d6ca661a04a9c1a9be3fa4b872fdd3c3ffb5058992ea39d0e4fc8ef273998a31ba585cad9d2
data/.rubocop.yml CHANGED
@@ -14,6 +14,10 @@ Metrics/MethodLength:
14
14
  Metrics/BlockLength:
15
15
  Exclude:
16
16
  - spec/**/*
17
+ Metrics/CyclomaticComplexity:
18
+ Enabled: false
19
+ Metrics/PerceivedComplexity:
20
+ Enabled: false
17
21
  Style/HashEachMethods:
18
22
  Enabled: true
19
23
  Style/HashTransformKeys:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.0.2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Biodiversity
2
2
 
3
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3569596.svg)](https://doi.org/10.5281/zenodo.3569596)
3
+ [![DOI](https://zenodo.org/badge/764046.svg)](https://zenodo.org/badge/latestdoi/764046)
4
4
  [![Gem Version][gem_svg]][gem_link]
5
5
  [![Continuous Integration Status][ci_svg]][ci_link]
6
6
 
data/biodiversity.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency 'rake', '~> 13.0'
26
26
  gem.add_development_dependency 'rspec', '~> 3.10'
27
27
  gem.add_development_dependency 'rubocop', '~> 1.8'
28
+ gem.add_development_dependency 'solargraph', '~> 0.43'
28
29
  end
Binary file
Binary file
Binary file
@@ -57,11 +57,14 @@ module Biodiversity
57
57
  with_details, with_cultivars)
58
58
  free_mem(ptr)
59
59
  if simple
60
- CSV.new(parsed).map do |row|
60
+ CSV.new(parsed.force_encoding('UTF-8')).map do |row|
61
61
  csv_row(row)
62
62
  end
63
63
  else
64
- JSON.parse(parsed, symbolize_names: true)
64
+ JSON.parse(parsed, symbolize_names: true).map do |item|
65
+ item[:parserVersion] = Biodiversity.gnparser_version
66
+ item
67
+ end
65
68
  end
66
69
  end
67
70
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  # Biodiversity module provides a namespace for scientific name parser.
4
4
  module Biodiversity
5
- VERSION = '5.3.0'
6
- GNPARSER_VERSION = 'GNparser 1.3.0+'
5
+ VERSION = '5.3.4'
6
+ GNPARSER_VERSION = 'GNparser 1.4.2'
7
7
 
8
8
  def self.version
9
9
  VERSION
@@ -49,18 +49,25 @@ describe Biodiversity::Parser do
49
49
  describe('parse_ary') do
50
50
  it 'parses names in simple format' do
51
51
  parsed = subject.parse_ary(
52
- ['Homo sapiens Linn.', 'Pardosa moesta'],
53
- simple: true
52
+ ['Homo sapiens Linn.', 'Pardosa moesta', 'Aus bus "White Russian"'],
53
+ simple: true, with_cultivars: true
54
54
  )
55
55
  expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
56
56
  expect(parsed[0][:normalized]).to be_nil
57
57
 
58
58
  expect(parsed[1][:canonical][:simple]).to eq 'Pardosa moesta'
59
+ expect(parsed[2][:canonical][:simple]).to eq 'Aus bus ‘White Russian’'
60
+ expect(parsed[2][:quality]).to eq 1
59
61
  end
60
62
 
61
63
  it 'parsed name in full format' do
62
64
  parsed = subject.parse_ary(
63
- ['Homo sapiens Linn.', 'Tobacco Mosaic Virus']
65
+ [
66
+ 'Homo sapiens Linn.',
67
+ 'Tobacco Mosaic Virus',
68
+ "Aus bus 'White Russian'"
69
+ ],
70
+ with_cultivars: true
64
71
  )
65
72
  expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
66
73
  expect(parsed[0][:normalized]).to eq 'Homo sapiens Linn.'
@@ -68,6 +75,9 @@ describe Biodiversity::Parser do
68
75
  expect(parsed[1][:parsed]).to be false
69
76
  expect(parsed[1][:virus]).to be true
70
77
  expect(parsed[1][:words]).to be_nil
78
+ expect(parsed[2][:canonical][:simple]).to eq 'Aus bus ‘White Russian’'
79
+ expect(parsed[2][:quality]).to eq 1
80
+ expect(parsed[2][:parserVersion]).to match(/GNparser/)
71
81
  end
72
82
  end
73
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biodiversity
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-03 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: solargraph
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.43'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.43'
97
111
  description: Parsing tool for biodiversity informatics
98
112
  email: dmozzherin@gmail.com
99
113
  executables: []
@@ -142,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
156
  - !ruby/object:Gem::Version
143
157
  version: '0'
144
158
  requirements: []
145
- rubygems_version: 3.2.15
159
+ rubygems_version: 3.2.22
146
160
  signing_key:
147
161
  specification_version: 4
148
162
  summary: Parser of scientific names