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 +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG +2 -0
- data/README.md +1 -1
- data/dwc-archive.gemspec +12 -13
- data/lib/dwc_archive.rb +1 -1
- data/lib/dwc_archive/classification_normalizer.rb +4 -2
- data/lib/dwc_archive/expander.rb +2 -5
- data/lib/dwc_archive/version.rb +1 -1
- data/spec/files/file with characters(3).gz b/data/spec/files/file with → characters(3).tar.gz +0 -0
- data/spec/lib/darwin_core_spec.rb +1 -10
- data/spec/spec_helper.rb +0 -3
- metadata +31 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fd098cb550fe49fe0b1e4234dee9d42a99fdea5a6ce41393a71c000802b3887
|
4
|
+
data.tar.gz: b637574ad6eda25ad8f1cb53538443529cd42ae0948530a09e3c080f16c2cb7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e8b88410e88f7ad3cabe6d02934db35143f88408d08164890e970c36af68cfc164c88b9bd644e723a2575e0f781e4ef7aa7b2726331a8a70d9f48498cc46a0d
|
7
|
+
data.tar.gz: 1d989666190f9e7333dae5eddff4c95b4f58797ebdffda3c5198625d4c869439f786beeb2d474e3a6260385320960b987d4329a072a5c01db30ccb040ef9e5ca
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.6
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/dwc-archive.gemspec
CHANGED
@@ -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.
|
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.
|
26
|
-
gem.add_runtime_dependency "
|
25
|
+
gem.add_runtime_dependency "nokogiri", "~> 1.10"
|
26
|
+
gem.add_runtime_dependency "biodiversity", "~> 4"
|
27
27
|
|
28
|
-
|
29
|
-
gem.add_development_dependency "bundler", "~> 1
|
30
|
-
gem.add_development_dependency "
|
31
|
-
gem.add_development_dependency "
|
32
|
-
gem.add_development_dependency "
|
33
|
-
gem.add_development_dependency "
|
34
|
-
gem.add_development_dependency "
|
35
|
-
gem.add_development_dependency "
|
36
|
-
gem.add_development_dependency "
|
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
|
data/lib/dwc_archive.rb
CHANGED
@@ -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 =
|
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 =
|
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
|
|
data/lib/dwc_archive/expander.rb
CHANGED
@@ -37,11 +37,8 @@ class DarwinCore
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def init_unpacker
|
40
|
-
|
41
|
-
|
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
|
|
data/lib/dwc_archive/version.rb
CHANGED
data/spec/files/file with characters(3).gz b/data/spec/files/file with → characters(3).tar.gz
RENAMED
File without changes
|
@@ -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
|
data/spec/spec_helper.rb
CHANGED
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
|
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:
|
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.
|
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.
|
26
|
+
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: biodiversity
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
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: '
|
40
|
+
version: '4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1
|
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
|
54
|
+
version: '11.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
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: '
|
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: '
|
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: '
|
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.
|
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.
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
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
|