dwc-archive 1.0.1 → 1.1.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: 8e61e692fe24c4b6bd56e38a7b19a357ba0acdd3180999e606bd6fc8e55dae29
4
- data.tar.gz: 1bf6ee067e24d6cb75d415eaa1f10bcf37a96d7daee7a1935248a6a58a0cb5ed
3
+ metadata.gz: 0fd098cb550fe49fe0b1e4234dee9d42a99fdea5a6ce41393a71c000802b3887
4
+ data.tar.gz: b637574ad6eda25ad8f1cb53538443529cd42ae0948530a09e3c080f16c2cb7b
5
5
  SHA512:
6
- metadata.gz: a162b05026795e2e4ea8e92683682fab820fb0cfcea68a8c166eb9dc012246ba01a16af4e17af39a2ae28bf2b6a3b85f877ac53b71e27915f8529cb4d973d67a
7
- data.tar.gz: 10a59bee9c60103c91fd5403c4c765903521e640dab3c6ef7ff78eaceb04938aa0bd554e9941bdd90260a2f0a2e4927be3d0ada830b2a4310be405f2ead1184f
6
+ metadata.gz: 7e8b88410e88f7ad3cabe6d02934db35143f88408d08164890e970c36af68cfc164c88b9bd644e723a2575e0f781e4ef7aa7b2726331a8a70d9f48498cc46a0d
7
+ data.tar.gz: 1d989666190f9e7333dae5eddff4c95b4f58797ebdffda3c5198625d4c869439f786beeb2d474e3a6260385320960b987d4329a072a5c01db30ccb040ef9e5ca
data/.gitignore CHANGED
@@ -26,5 +26,6 @@ bin
26
26
  .bundle
27
27
  bundle_bin
28
28
  Gemfile.lock
29
+ .byebug_history
29
30
 
30
31
 
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4
2
+ TargetRubyVersion: 2.6
3
3
  Exclude:
4
4
  - features/**/*
5
5
  - .bundle/**/*
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.6.6
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 1.1.0 Update name parser to go-based biodiversity
2
+
1
3
  1.0.1 Cleanup and gems update
2
4
 
3
5
  0.9.11 Removed VERSION duplicate
data/README.md CHANGED
@@ -27,7 +27,7 @@ Usage
27
27
 
28
28
  ```ruby
29
29
  require 'rubygems'
30
- require 'dwc-archive'
30
+ require 'dwc_archive'
31
31
 
32
32
  dwc = DarwinCore.new('/path_to_file/archive_file.tar.gz')
33
33
  dwc.archive.files # the archive file list
@@ -15,24 +15,23 @@ Gem::Specification.new do |gem|
15
15
  gem.homepage = "http://github.com/GlobalNamesArchitecture/dwc-archive"
16
16
  gem.license = "MIT"
17
17
 
18
- gem.required_ruby_version = ">= 2.4.1"
18
+ gem.required_ruby_version = ">= 2.6.6"
19
19
  gem.files = `git ls-files`.split("\n").map(&:strip)
20
20
  gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
21
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
22
22
  gem.require_paths = ["lib"]
23
23
 
24
24
  # gem.add_runtime_dependency "minitar", "~> 0.6"
25
- gem.add_runtime_dependency "nokogiri", "~> 1.8"
26
- gem.add_runtime_dependency "parsley-store", "~> 0.3"
25
+ gem.add_runtime_dependency "nokogiri", "~> 1.10"
26
+ gem.add_runtime_dependency "biodiversity", "~> 4"
27
27
 
28
- # gem.add_development_dependency "byebug", "~> 3.4"
29
- gem.add_development_dependency "bundler", "~> 1.16"
30
- gem.add_development_dependency "coveralls", "~> 0.8"
31
- gem.add_development_dependency "cucumber", "~> 3.1"
32
- gem.add_development_dependency "git", "~> 1.4"
33
- gem.add_development_dependency "rake", "~> 12.3"
34
- gem.add_development_dependency "rspec", "~> 3.7"
35
- gem.add_development_dependency "rubocop", "~> 0.58"
36
- gem.add_development_dependency "solargraph", "~> 0.23"
37
- gem.add_development_dependency "travis", "~> 1.8"
28
+ gem.add_development_dependency "byebug", "~> 11.1"
29
+ gem.add_development_dependency "bundler", "~> 2.1"
30
+ gem.add_development_dependency "cucumber", "~> 4"
31
+ gem.add_development_dependency "git", "~> 1.7"
32
+ gem.add_development_dependency "rake", "~> 13"
33
+ gem.add_development_dependency "rspec", "~> 3.9"
34
+ gem.add_development_dependency "rubocop", "~> 0.85"
35
+ gem.add_development_dependency "solargraph", "~> 0.39"
36
+ gem.add_development_dependency "travis", "~> 1.9"
38
37
  end
@@ -6,7 +6,7 @@ require "digest"
6
6
  require "csv"
7
7
  require "logger"
8
8
  require "nokogiri"
9
- require "parsley-store"
9
+ require "biodiversity"
10
10
  require_relative "dwc_archive/xml_reader"
11
11
  require_relative "dwc_archive/ingester"
12
12
  require_relative "dwc_archive/errors"
@@ -12,7 +12,7 @@ class DarwinCore
12
12
  @extensions = @dwc.extensions.map { |e| [e, find_fields(e)] }
13
13
  @normalized_data = {}
14
14
  @synonyms = {}
15
- @parser = ParsleyStore.new(1, 2)
15
+ @parser = ::Biodiversity::Parser
16
16
  @name_strings = {}
17
17
  @vernacular_name_strings = {}
18
18
  @error_names = []
@@ -70,7 +70,9 @@ class DarwinCore
70
70
 
71
71
  def get_canonical_name(a_scientific_name)
72
72
  return nil unless @with_canonical_names
73
- canonical_name = @parser.parse(a_scientific_name, canonical_only: true)
73
+ canonical_name = nil
74
+ parsed = @parser.parse(a_scientific_name)
75
+ canonical_name = parsed[:canonicalName][:simple] if parsed[:parsed]
74
76
  canonical_name.to_s.empty? ? a_scientific_name : canonical_name
75
77
  end
76
78
 
@@ -37,11 +37,8 @@ class DarwinCore
37
37
  private
38
38
 
39
39
  def init_unpacker
40
- file_command = IO.popen("file -z " + esc(@archive_path))
41
- file_type = file_command.read
42
- file_command.close
43
- return tar_unpacker if file_type =~ /tar.*gzip/i
44
- return zip_unpacker if file_type =~ /Zip/
40
+ return tar_unpacker if @archive_path =~ /tar.gz$/i
41
+ return zip_unpacker if @archive_path =~ /zip$/i
45
42
  nil
46
43
  end
47
44
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version constant of the class
4
4
  class DarwinCore
5
- VERSION = "1.0.1"
5
+ VERSION = "1.1.0"
6
6
  end
@@ -4,15 +4,6 @@ describe DarwinCore do
4
4
  subject { DarwinCore }
5
5
  let(:file_dir) { File.expand_path("../files", __dir__) }
6
6
 
7
- describe "redis connection" do
8
- it "redis is running" do
9
- expect do
10
- socket = TCPSocket.open("localhost", 6379)
11
- socket.close
12
- end.to_not raise_error
13
- end
14
- end
15
-
16
7
  it "has version" do
17
8
  expect(DarwinCore::VERSION).to match(/\d+\.\d+\.\d/)
18
9
  end
@@ -121,7 +112,7 @@ describe DarwinCore do
121
112
  end
122
113
 
123
114
  context "filename with spaces and non-alphanumeric chars" do
124
- let(:file_path) { File.join(file_dir, "file with characters(3).gz") }
115
+ let(:file_path) { File.join(file_dir, "file with characters(3).tar.gz") }
125
116
 
126
117
  it "creates archive" do
127
118
  expect(dwca.archive.valid?).to be true
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "coveralls"
4
- Coveralls.wear!
5
-
6
3
  require "dwc_archive"
7
4
  require "rspec"
8
5
  require "rspec/mocks"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwc-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.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: 2018-07-17 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,154 +16,154 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '1.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
- name: parsley-store
28
+ name: biodiversity
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.3'
33
+ version: '4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.3'
40
+ version: '4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: '11.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: '11.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.8'
61
+ version: '2.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.8'
68
+ version: '2.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.1'
75
+ version: '4'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.1'
82
+ version: '4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: git
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.4'
89
+ version: '1.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.4'
96
+ version: '1.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '12.3'
103
+ version: '13'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '12.3'
110
+ version: '13'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.7'
117
+ version: '3.9'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.7'
124
+ version: '3.9'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.58'
131
+ version: '0.85'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.58'
138
+ version: '0.85'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: solargraph
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.23'
145
+ version: '0.39'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.23'
152
+ version: '0.39'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: travis
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.8'
159
+ version: '1.9'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.8'
166
+ version: '1.9'
167
167
  description: Darwin Core Archive is the current standard exchange format for GLobal
168
168
  Names Architecture modules. This gem makes it easy to incorporate files in Darwin
169
169
  Core Archive format into a ruby project.
@@ -212,7 +212,7 @@ files:
212
212
  - spec/files/data_with_quotes.tar.gz
213
213
  - spec/files/eml.xml
214
214
  - spec/files/empty_coreid.tar.gz
215
- - spec/files/file with characters(3).gz
215
+ - spec/files/file with characters(3).tar.gz
216
216
  - spec/files/flat_list.tar.gz
217
217
  - spec/files/generator_eml.xml
218
218
  - spec/files/generator_meta.xml
@@ -253,15 +253,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
253
  requirements:
254
254
  - - ">="
255
255
  - !ruby/object:Gem::Version
256
- version: 2.4.1
256
+ version: 2.6.6
257
257
  required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  requirements:
259
259
  - - ">="
260
260
  - !ruby/object:Gem::Version
261
261
  version: '0'
262
262
  requirements: []
263
- rubyforge_project:
264
- rubygems_version: 2.7.6
263
+ rubygems_version: 3.0.3
265
264
  signing_key:
266
265
  specification_version: 4
267
266
  summary: Handler of Darwin Core Archive files
@@ -277,7 +276,7 @@ test_files:
277
276
  - spec/files/data_with_quotes.tar.gz
278
277
  - spec/files/eml.xml
279
278
  - spec/files/empty_coreid.tar.gz
280
- - spec/files/file with characters(3).gz
279
+ - spec/files/file with characters(3).tar.gz
281
280
  - spec/files/flat_list.tar.gz
282
281
  - spec/files/generator_eml.xml
283
282
  - spec/files/generator_meta.xml