biodiversity 5.1.0 → 5.1.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: b9df90a14b8fcc999def9b89b58ea277e37749eca303f858ebaee03159bb60d8
4
- data.tar.gz: b6f8ed59091c85d12fb660a608444f94c2974c4f7720e7b085b5c02265cad296
3
+ metadata.gz: 04ea2a69ec867a904293aaaf7c482970c7f456d5025b103e6e45ce6ff89a686e
4
+ data.tar.gz: 14b251bb4b841f2916151002e8ed4718ef8732b771069a1543ab1b0c0402585d
5
5
  SHA512:
6
- metadata.gz: b2c749612aed3f60f3fc3041a4685a7f45651ba438d7058687433a8b039443487b3e2e9ff90cf9a976cab5b183bac513ae611d238ceed2353e3ad491f963e81c
7
- data.tar.gz: 2765731a3d3a9dfd5bb346246ce8afe741bf9a0b74e9c50bced34d3f82da9ce5e1a56c6d671373b6c0973e4afc63f913bc7badf2f7073f059a2c38aeebfc817c
6
+ metadata.gz: 9addd540eb74d8bfdc3d851fc2a277e9bc613b588dc12b22ccfcb59b901ac16293297d464f7e56c09b3dd6ecdf3412e95954fcf7eda7bc9bdcb816006f36a898
7
+ data.tar.gz: 36364f23418870c90578a6ffd779faeff07d2cee2cb9f2b3c6e6dd1e03c925e93c6fabc3fc7191c55bcc1d27ee1b5bb1ac3968bca4ed7a112503aa5abaf771fe
@@ -33,18 +33,18 @@ module Biodiversity
33
33
  %i[pointer int string int], :strptr)
34
34
  attach_function(:free_mem, :FreeMemory, %i[pointer], :void)
35
35
 
36
- def self.parse(name, simple: false, details: false)
36
+ def self.parse(name, simple: false)
37
37
  format = simple ? 'csv' : 'compact'
38
- with_details = details ? 1 : 0
38
+ with_details = simple ? 0 : 1
39
39
 
40
40
  parsed, ptr = parse_go(name, format, with_details)
41
41
  free_mem(ptr)
42
42
  output(parsed, simple)
43
43
  end
44
44
 
45
- def self.parse_ary(ary, simple: false, details: false)
45
+ def self.parse_ary(ary, simple: false)
46
46
  format = simple ? 'csv' : 'compact'
47
- with_details = details ? 1 : 0
47
+ with_details = simple ? 0 : 1
48
48
 
49
49
  in_ptr = FFI::MemoryPointer.new(:pointer, ary.length)
50
50
  in_ptr.write_array_of_pointer(
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Biodiversity module provides a namespace for scientific name parser.
4
4
  module Biodiversity
5
- VERSION = '5.1.0'
5
+ VERSION = '5.1.1'
6
6
 
7
7
  def self.version
8
8
  VERSION
@@ -14,6 +14,7 @@ describe Biodiversity::Parser do
14
14
  parsed = subject.parse('Homo sapiens Linn.')
15
15
  expect(parsed[:canonical][:simple]).to eq 'Homo sapiens'
16
16
  expect(parsed[:normalized]).to eq 'Homo sapiens Linn.'
17
+ expect(parsed[:words].size).to eq 3
17
18
  end
18
19
 
19
20
  it 'gets quality and year correctly in simple form' do
@@ -32,8 +33,9 @@ describe Biodiversity::Parser do
32
33
  simple: true
33
34
  )
34
35
  expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
35
- expect(parsed[1][:canonical][:simple]).to eq 'Pardosa moesta'
36
36
  expect(parsed[0][:normalized]).to be_nil
37
+
38
+ expect(parsed[1][:canonical][:simple]).to eq 'Pardosa moesta'
37
39
  end
38
40
 
39
41
  it 'parsed name in full format' do
@@ -42,8 +44,10 @@ describe Biodiversity::Parser do
42
44
  )
43
45
  expect(parsed[0][:canonical][:simple]).to eq 'Homo sapiens'
44
46
  expect(parsed[0][:normalized]).to eq 'Homo sapiens Linn.'
47
+ expect(parsed[0][:words].size).to eq 3
45
48
  expect(parsed[1][:parsed]).to be false
46
49
  expect(parsed[1][:virus]).to be true
50
+ expect(parsed[1][:words]).to be_nil
47
51
  end
48
52
  end
49
53
  end
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: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin