gnparser 0.4.0 → 0.5.0

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: 874326057814cbb368cc59f78df30e16faae8ba69dfe86140686597e779cb6b0
4
- data.tar.gz: 904391d4ef7e7d5c48c58df05a343823fff0841b96edb82ae36a5fd7135e7df6
3
+ metadata.gz: ee60435b3b83e338ef45457f0ac6c809dac4e7b6efad9e96ee9f3ffc66363c76
4
+ data.tar.gz: eed51e44fcfe2ee9939e0201ffb768e259acfdbbc60c9701efc5e0ce147c215d
5
5
  SHA512:
6
- metadata.gz: 513947853fec9b99cccc50819e1b7b4a5f6ea1558c6307e9d7d91e862a86f1fe4d26066ef1c2d9d20b6b25dd08629573c7f37e461b7b44014ae4b74361b41029
7
- data.tar.gz: 1747254684ba4f37eda45db9b4ac4992e603ef98f63b10c231e06b1deab845892ce2d1e4694621982f0ae42929312cb0fcb0f1bba9d0b9469a6ade8b32c29eaf
6
+ metadata.gz: 3b7183db1c922b54d8d8e44089c011df900c9c9652d1f444eff139478c5dcbf14b01d91c3cbc6c37b8c5e514e2ef616336c76cc7c507773f1526ac0838b1664d
7
+ data.tar.gz: 490f323db0aae6c4bc6c6217de1f5eb05747da04c6ee6cfe46ed20c7a7e0aa89d7bf098f499bdea373b185d0de385a0e23caaca8c3d6b61a9af965650b4a03a3
data/.rubocop.yml CHANGED
@@ -5,6 +5,8 @@ AllCops:
5
5
  - 'lib/gnparser_services_pb.rb'
6
6
  Style/StringLiterals:
7
7
  EnforcedStyle: single_quotes
8
+ Metrics/AbcSize:
9
+ Max: 30
8
10
  Metrics/BlockLength:
9
11
  Exclude:
10
12
  - 'spec/**/*'
data/gnparser.gemspec CHANGED
@@ -28,4 +28,5 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency 'rake', '~> 12.3'
29
29
  gem.add_development_dependency 'rspec', '~> 3.8'
30
30
  gem.add_development_dependency 'rubocop', '~> 0.59'
31
+ gem.add_development_dependency 'solargraph', '~> 0.38.0'
31
32
  end
@@ -8,11 +8,22 @@ module GNparser
8
8
  def initialize(host = '0.0.0.0', port = '8778')
9
9
  @stub = Pb::GNparser::Stub.new("#{host}:#{port}",
10
10
  :this_channel_is_insecure)
11
- return if parser_version.value >= PARSER_MIN_VERSION
11
+ return if supported_parser(parser_version.value)
12
12
 
13
13
  raise 'gRPC server of gnparser should be at least ' \
14
- ' #{PARSER_MIN_VERSION}.\n Download latest version from ' \
15
- 'https://gitlab/gogna/gnparser/releases.'
14
+ " #{PARSER_MIN_VERSION}.\n Download latest version from " \
15
+ 'https://gitlab/gogna/gnparser/releases. '
16
+ end
17
+
18
+ def supported_parser(ver_str)
19
+ return true if ver_str == PARSER_MIN_VERSION
20
+
21
+ ver = ver_str[1..-1].split('.')
22
+ ref = PARSER_MIN_VERSION[1..-1].split('.')
23
+ return true if ver[0].to_i > ref[0].to_i || ver[1].to_i > ref[1].to_i ||
24
+ ver[2].to_i > ref[2].to_i
25
+
26
+ false
16
27
  end
17
28
 
18
29
  # parser_version retrieves the version of gnparser used by gRPC service.
@@ -2,7 +2,7 @@
2
2
 
3
3
  # GNparser is a namespace module for gnparser gem.
4
4
  module GNparser
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
 
7
7
  def self.version
8
8
  VERSION
data/lib/gnparser_pb.rb CHANGED
@@ -4,124 +4,127 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "pb.Version" do
8
- optional :value, :string, 1
9
- optional :build_time, :string, 2
10
- end
11
- add_message "pb.Void" do
12
- end
13
- add_message "pb.InputArray" do
14
- optional :jobs_number, :int32, 1
15
- optional :skip_cleaning, :bool, 2
16
- repeated :names, :string, 3
17
- end
18
- add_message "pb.OutputArray" do
19
- repeated :output, :message, 1, "pb.Parsed"
20
- end
21
- add_message "pb.Parsed" do
22
- optional :parsed, :bool, 1
23
- optional :quality, :int32, 2
24
- repeated :quality_warning, :message, 3, "pb.QualityWarning"
25
- optional :verbatim, :string, 4
26
- optional :normalized, :string, 5
27
- optional :canonical, :message, 6, "pb.Canonical"
28
- optional :authorship, :message, 7, "pb.Authorship"
29
- repeated :positions, :message, 8, "pb.Position"
30
- optional :hybrid, :bool, 9
31
- optional :bacteria, :bool, 10
32
- optional :tail, :string, 11
33
- optional :id, :string, 12
34
- optional :parser_version, :string, 13
35
- optional :cardinality, :int32, 14
36
- optional :name_type, :enum, 15, "pb.NameType"
37
- repeated :details_hybrid_formula, :message, 20, "pb.HybridFormula"
38
- oneof :details do
39
- optional :uninomial, :message, 16, "pb.Uninomial"
40
- optional :species, :message, 17, "pb.Species"
41
- optional :comparison, :message, 18, "pb.Comparison"
42
- optional :approximation, :message, 19, "pb.Approximation"
7
+ add_file("gnparser.proto", :syntax => :proto3) do
8
+ add_message "pb.Version" do
9
+ optional :value, :string, 1
10
+ optional :build_time, :string, 2
43
11
  end
44
- end
45
- add_message "pb.HybridFormula" do
46
- oneof :element do
47
- optional :uninomial, :message, 1, "pb.Uninomial"
48
- optional :species, :message, 2, "pb.Species"
49
- optional :comparison, :message, 3, "pb.Comparison"
50
- optional :approximation, :message, 4, "pb.Approximation"
12
+ add_message "pb.Void" do
13
+ end
14
+ add_message "pb.InputArray" do
15
+ optional :jobs_number, :int32, 1
16
+ optional :skip_cleaning, :bool, 2
17
+ repeated :names, :string, 3
18
+ end
19
+ add_message "pb.OutputArray" do
20
+ repeated :output, :message, 1, "pb.Parsed"
21
+ end
22
+ add_message "pb.Parsed" do
23
+ optional :parsed, :bool, 1
24
+ optional :quality, :int32, 2
25
+ repeated :quality_warning, :message, 3, "pb.QualityWarning"
26
+ optional :verbatim, :string, 4
27
+ optional :normalized, :string, 5
28
+ optional :canonical, :message, 6, "pb.Canonical"
29
+ optional :authorship, :message, 7, "pb.Authorship"
30
+ repeated :positions, :message, 8, "pb.Position"
31
+ optional :hybrid, :bool, 9
32
+ optional :bacteria, :bool, 10
33
+ optional :tail, :string, 11
34
+ optional :id, :string, 12
35
+ optional :parser_version, :string, 13
36
+ optional :cardinality, :int32, 14
37
+ optional :name_type, :enum, 15, "pb.NameType"
38
+ repeated :details_hybrid_formula, :message, 20, "pb.HybridFormula"
39
+ oneof :details do
40
+ optional :uninomial, :message, 16, "pb.Uninomial"
41
+ optional :species, :message, 17, "pb.Species"
42
+ optional :comparison, :message, 18, "pb.Comparison"
43
+ optional :approximation, :message, 19, "pb.Approximation"
44
+ end
45
+ end
46
+ add_message "pb.HybridFormula" do
47
+ oneof :element do
48
+ optional :uninomial, :message, 1, "pb.Uninomial"
49
+ optional :species, :message, 2, "pb.Species"
50
+ optional :comparison, :message, 3, "pb.Comparison"
51
+ optional :approximation, :message, 4, "pb.Approximation"
52
+ end
53
+ end
54
+ add_message "pb.Canonical" do
55
+ optional :stem, :string, 1
56
+ optional :simple, :string, 2
57
+ optional :full, :string, 3
58
+ end
59
+ add_message "pb.Position" do
60
+ optional :type, :string, 1
61
+ optional :start, :int32, 2
62
+ optional :end, :int32, 3
63
+ end
64
+ add_message "pb.QualityWarning" do
65
+ optional :quality, :int32, 1
66
+ optional :message, :string, 2
67
+ end
68
+ add_message "pb.Uninomial" do
69
+ optional :value, :string, 1
70
+ optional :rank, :string, 2
71
+ optional :parent, :string, 3
72
+ optional :authorship, :message, 4, "pb.Authorship"
73
+ end
74
+ add_message "pb.Species" do
75
+ optional :genus, :string, 1
76
+ optional :sub_genus, :string, 2
77
+ optional :species, :string, 3
78
+ optional :species_authorship, :message, 4, "pb.Authorship"
79
+ repeated :infra_species, :message, 5, "pb.InfraSpecies"
80
+ end
81
+ add_message "pb.InfraSpecies" do
82
+ optional :value, :string, 1
83
+ optional :rank, :string, 2
84
+ optional :authorship, :message, 3, "pb.Authorship"
85
+ end
86
+ add_message "pb.Comparison" do
87
+ optional :genus, :string, 1
88
+ optional :species, :string, 2
89
+ optional :species_authorship, :message, 3, "pb.Authorship"
90
+ optional :comparison, :string, 4
91
+ end
92
+ add_message "pb.Approximation" do
93
+ optional :genus, :string, 1
94
+ optional :species, :string, 2
95
+ optional :species_authorship, :message, 3, "pb.Authorship"
96
+ optional :approximation, :string, 4
97
+ optional :ignored, :string, 5
98
+ end
99
+ add_message "pb.Authorship" do
100
+ optional :value, :string, 1
101
+ repeated :all_authors, :string, 2
102
+ optional :original, :message, 3, "pb.AuthGroup"
103
+ optional :combination, :message, 4, "pb.AuthGroup"
104
+ end
105
+ add_message "pb.AuthGroup" do
106
+ repeated :authors, :string, 1
107
+ optional :year, :string, 2
108
+ optional :approximate_year, :bool, 3
109
+ optional :ex_authors, :message, 4, "pb.Authors"
110
+ optional :emend_authors, :message, 5, "pb.Authors"
111
+ end
112
+ add_message "pb.Authors" do
113
+ repeated :authors, :string, 1
114
+ optional :year, :string, 2
115
+ optional :approximate_year, :bool, 3
116
+ end
117
+ add_enum "pb.NameType" do
118
+ value :NONE, 0
119
+ value :UNINOMIAL, 1
120
+ value :SPECIES, 2
121
+ value :COMPARISON, 3
122
+ value :APPROX_SURROGATE, 4
123
+ value :SURROGATE, 5
124
+ value :NAMED_HYBRID, 6
125
+ value :HYBRID_FORMULA, 7
126
+ value :VIRUS, 8
51
127
  end
52
- end
53
- add_message "pb.Canonical" do
54
- optional :simple, :string, 1
55
- optional :full, :string, 2
56
- end
57
- add_message "pb.Position" do
58
- optional :type, :string, 1
59
- optional :start, :int32, 2
60
- optional :end, :int32, 3
61
- end
62
- add_message "pb.QualityWarning" do
63
- optional :quality, :int32, 1
64
- optional :message, :string, 2
65
- end
66
- add_message "pb.Uninomial" do
67
- optional :value, :string, 1
68
- optional :rank, :string, 2
69
- optional :parent, :string, 3
70
- optional :authorship, :message, 4, "pb.Authorship"
71
- end
72
- add_message "pb.Species" do
73
- optional :genus, :string, 1
74
- optional :sub_genus, :string, 2
75
- optional :species, :string, 3
76
- optional :species_authorship, :message, 4, "pb.Authorship"
77
- repeated :infra_species, :message, 5, "pb.InfraSpecies"
78
- end
79
- add_message "pb.InfraSpecies" do
80
- optional :value, :string, 1
81
- optional :rank, :string, 2
82
- optional :authorship, :message, 3, "pb.Authorship"
83
- end
84
- add_message "pb.Comparison" do
85
- optional :genus, :string, 1
86
- optional :species, :string, 2
87
- optional :species_authorship, :message, 3, "pb.Authorship"
88
- optional :comparison, :string, 4
89
- end
90
- add_message "pb.Approximation" do
91
- optional :genus, :string, 1
92
- optional :species, :string, 2
93
- optional :species_authorship, :message, 3, "pb.Authorship"
94
- optional :approximation, :string, 4
95
- optional :ignored, :string, 5
96
- end
97
- add_message "pb.Authorship" do
98
- optional :value, :string, 1
99
- repeated :all_authors, :string, 2
100
- optional :original, :message, 3, "pb.AuthGroup"
101
- optional :combination, :message, 4, "pb.AuthGroup"
102
- end
103
- add_message "pb.AuthGroup" do
104
- repeated :authors, :string, 1
105
- optional :year, :string, 2
106
- optional :approximate_year, :bool, 3
107
- optional :ex_authors, :message, 4, "pb.Authors"
108
- optional :emend_authors, :message, 5, "pb.Authors"
109
- end
110
- add_message "pb.Authors" do
111
- repeated :authors, :string, 1
112
- optional :year, :string, 2
113
- optional :approximate_year, :bool, 3
114
- end
115
- add_enum "pb.NameType" do
116
- value :NONE, 0
117
- value :UNINOMIAL, 1
118
- value :SPECIES, 2
119
- value :COMPARISON, 3
120
- value :APPROX_SURROGATE, 4
121
- value :SURROGATE, 5
122
- value :NAMED_HYBRID, 6
123
- value :HYBRID_FORMULA, 7
124
- value :VIRUS, 8
125
128
  end
126
129
  end
127
130
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.59'
111
+ - !ruby/object:Gem::Dependency
112
+ name: solargraph
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.38.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.38.0
111
125
  description: |-
112
126
  The gem parses scientific names into semantic elements
113
127
  using gRPC of gnparser app written in Go.
@@ -150,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
164
  - !ruby/object:Gem::Version
151
165
  version: '0'
152
166
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.7.6
167
+ rubygems_version: 3.0.3
155
168
  signing_key:
156
169
  specification_version: 4
157
170
  summary: Scientific name parser