biodiversity 4.0.0 → 4.0.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
  SHA256:
3
- metadata.gz: be6873b8833844649f8f58641c1cb12250d6b539cdaa12c7e4657433c17ea2c1
4
- data.tar.gz: 70ff3729b66bb1f8ae6eb7f553c1fe48d98cd191020f5a6ccf03b2f509843865
3
+ metadata.gz: 16f738b68e5581556761d12404e66562493718d0075df611f65780f445ebd265
4
+ data.tar.gz: 24822d2bfa6f0fb5ed1f035dfc5ef9461025b50766fd8191a853d70d2349a348
5
5
  SHA512:
6
- metadata.gz: b4bd5630b6e1401c98c0ed9fefdd945d7dd21f52ec911a6ca235163f6497c72ce94ad0dc957919601f87cdd73ce67c3f7274e910e7af1497d672eefdfa2a9d2b
7
- data.tar.gz: 14a5920a83bb40a7d2f51d6bf633d1dc6415e596013a3a54ab1c27d07fdd0d64a5c2fb50fb4a47c430552d6a7c5f5c0e2a5ede9cc9890f295b3dcc1cec0e1fa8
6
+ metadata.gz: 96b035faa977f9b10d253af2fe82938d7234bc572c031e726b1893ef5c93293771afe8e37a20d46355ee04958b7432ece52a9eba9ee8789432e8ea46f283ccb2
7
+ data.tar.gz: 57d5a7fdf457fa6fe236ca5ff6b0e270632b39dd7529629bc12f2f16822e08f8fbbf2ef57a8f298fbad8e50fd69794d052f21cc93ceb8e3f29b27424d4bba040
@@ -1,6 +1,7 @@
1
1
  rvm:
2
2
  - 2.5
3
3
  - 2.6
4
+ before_install: "gem update bundler"
4
5
  branches:
5
6
  only:
6
7
  - master
data/README.md CHANGED
@@ -15,6 +15,11 @@ and better than previous versions.
15
15
  This gem does not have a remote server or a command line executable anymore.
16
16
  For such features use https://gitlab.com/gogna/gnparser.
17
17
 
18
+ - [Biodiversity](#biodiversity)
19
+ - [Installation](#installation)
20
+ - [Example usage](#example-usage)
21
+ - [What is "nameStringID" in the parsed results?](#what-is-%22namestringid%22-in-the-parsed-results)
22
+ - [Copyright](#copyright)
18
23
 
19
24
  ## Installation
20
25
 
@@ -40,13 +45,13 @@ Biodiversity.version
40
45
  Biodiversity::Parser.parse("Plantago major", simple = true)
41
46
 
42
47
  # to parse many scientific names using all computer CPUs
43
- Biodiversity::Parser.parse(["Plantago major", ... ], simple = true)
48
+ Biodiversity::Parser.parse_ary(["Plantago major", ... ], simple = true)
44
49
 
45
50
  # to parse a scientific name into a very detailed Ruby hash
46
51
  Biodiversity::Parser.parse("Plantago major")
47
52
 
48
53
  # to parse many scientific names with all details using all computer CPUs
49
- Biodiversity::Parser.parse(["Plantago major", ... ])
54
+ Biodiversity::Parser.parse_ary(["Plantago major", ... ])
50
55
 
51
56
  #to get json representation
52
57
  Biodiversity::Parser.parse("Plantago").to_json
@@ -68,7 +68,8 @@ module Biodiversity
68
68
  stem: parsed[4]
69
69
  },
70
70
  authorship: parsed[5],
71
- quality: parsed[6]
71
+ year: parsed[6],
72
+ quality: parsed[7]
72
73
  }
73
74
  else
74
75
  JSON.parse(parsed, symbolize_names: true)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Biodiversity module provides a namespace for scientific name parser.
4
4
  module Biodiversity
5
- VERSION = '4.0.0'
5
+ VERSION = '4.0.1'
6
6
 
7
7
  def self.version
8
8
  VERSION
@@ -15,6 +15,14 @@ describe Biodiversity::Parser do
15
15
  expect(parsed[:canonicalName][:simple]).to eq 'Homo sapiens'
16
16
  expect(parsed[:normalized]).to eq 'Homo sapiens Linn.'
17
17
  end
18
+
19
+ it 'gets quality and year correctly in simple form' do
20
+ parsed = subject.parse('Homo sapiens Linn. 1758', true)
21
+ expect(parsed[:canonicalName][:simple]).to eq 'Homo sapiens'
22
+ expect(parsed[:year]).to eq '1758'
23
+ expect(parsed[:quality]).to eq '1'
24
+ expect(parsed[:normalized]).to be_nil
25
+ end
18
26
  end
19
27
 
20
28
  describe('parse_ary') do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biodiversity
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin