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 +4 -4
- data/.travis.yml +1 -0
- data/README.md +7 -2
- data/lib/biodiversity/parser.rb +2 -1
- data/lib/biodiversity/version.rb +1 -1
- data/spec/lib/parser_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16f738b68e5581556761d12404e66562493718d0075df611f65780f445ebd265
|
4
|
+
data.tar.gz: 24822d2bfa6f0fb5ed1f035dfc5ef9461025b50766fd8191a853d70d2349a348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96b035faa977f9b10d253af2fe82938d7234bc572c031e726b1893ef5c93293771afe8e37a20d46355ee04958b7432ece52a9eba9ee8789432e8ea46f283ccb2
|
7
|
+
data.tar.gz: 57d5a7fdf457fa6fe236ca5ff6b0e270632b39dd7529629bc12f2f16822e08f8fbbf2ef57a8f298fbad8e50fd69794d052f21cc93ceb8e3f29b27424d4bba040
|
data/.travis.yml
CHANGED
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.
|
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.
|
54
|
+
Biodiversity::Parser.parse_ary(["Plantago major", ... ])
|
50
55
|
|
51
56
|
#to get json representation
|
52
57
|
Biodiversity::Parser.parse("Plantago").to_json
|
data/lib/biodiversity/parser.rb
CHANGED
data/lib/biodiversity/version.rb
CHANGED
data/spec/lib/parser_spec.rb
CHANGED
@@ -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
|