dataverse 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/dataverse/dataset.rb +4 -2
- data/lib/dataverse/dataverse.rb +2 -1
- data/lib/dataverse/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49b1b7ca158eabe9bc66b2bd0e83a6e1da6aa0fe6984acef57119a477bc0252d
|
4
|
+
data.tar.gz: 426a3872a464ec3954b71b1c87851795be6ac219ef2f9777e38748f2c00b4914
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3bb597791841213b4c1b445e62b511f5de2226e55ade9b16134afa3d96b7963892e42d429397a938237bb02f596662ba757d0497981c7419cdb284e0ecc1c32
|
7
|
+
data.tar.gz: cd3bf30ffc312df8142d2c176c3ecc7caddafb9e6a47bdcff2a364236d7e2841de05d8d789ff87cbf97efe32021e541cd1418ea515e4665edba1feaa404457f3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dataverse (0.1.
|
4
|
+
dataverse (0.1.8)
|
5
5
|
rest-client (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -14,12 +14,12 @@ GEM
|
|
14
14
|
unf (>= 0.0.5, < 1.0.0)
|
15
15
|
dotenv (2.7.6)
|
16
16
|
http-accept (1.7.0)
|
17
|
-
http-cookie (1.0.
|
17
|
+
http-cookie (1.0.5)
|
18
18
|
domain_name (~> 0.5)
|
19
19
|
method_source (1.0.0)
|
20
20
|
mime-types (3.4.1)
|
21
21
|
mime-types-data (~> 3.2015)
|
22
|
-
mime-types-data (3.
|
22
|
+
mime-types-data (3.2022.0105)
|
23
23
|
netrc (0.11.0)
|
24
24
|
pry (0.14.1)
|
25
25
|
coderay (~> 1.1)
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
rspec-support (3.10.3)
|
46
46
|
unf (0.1.4)
|
47
47
|
unf_ext
|
48
|
-
unf_ext (0.0.8)
|
48
|
+
unf_ext (0.0.8.2)
|
49
49
|
|
50
50
|
PLATFORMS
|
51
51
|
ruby
|
@@ -60,4 +60,4 @@ DEPENDENCIES
|
|
60
60
|
rspec (~> 3.0)
|
61
61
|
|
62
62
|
BUNDLED WITH
|
63
|
-
2.2.
|
63
|
+
2.2.32
|
data/lib/dataverse/dataset.rb
CHANGED
@@ -141,7 +141,7 @@ module Dataverse
|
|
141
141
|
.merge('metadata' => metadata(version: version))
|
142
142
|
.merge('files' => files(version: version))
|
143
143
|
.tap do |h|
|
144
|
-
h['license']
|
144
|
+
h['license'] ||= {
|
145
145
|
'name' => license_spdx(h),
|
146
146
|
'label' => license_name(h),
|
147
147
|
'uri' => license_url(h),
|
@@ -286,12 +286,14 @@ module Dataverse
|
|
286
286
|
|
287
287
|
def process_data(data)
|
288
288
|
return {} if data.nil? || data.empty?
|
289
|
+
return {} unless data.has_key?('latestVersion')
|
289
290
|
version_data = data.delete('latestVersion')
|
290
291
|
process_version_data(version_data)
|
291
292
|
data
|
292
293
|
end
|
293
294
|
|
294
295
|
def process_version_data(data)
|
296
|
+
return nil unless data
|
295
297
|
metadata = pack_metadata(data.delete('metadataBlocks'))
|
296
298
|
files = pack_files(data.delete('files'))
|
297
299
|
version = get_version_number(data)
|
@@ -318,7 +320,7 @@ module Dataverse
|
|
318
320
|
|
319
321
|
def pack_metadata(metadata)
|
320
322
|
data = {}
|
321
|
-
metadata.each_value do |block|
|
323
|
+
(metadata || {}).each_value do |block|
|
322
324
|
block['fields'].each do |field|
|
323
325
|
data[field['typeName']] = field_to_value(field)
|
324
326
|
end
|
data/lib/dataverse/dataverse.rb
CHANGED
@@ -83,7 +83,8 @@ module Dataverse
|
|
83
83
|
when 'dataverse'
|
84
84
|
result << Dataverse.id(x['id'])
|
85
85
|
when 'dataset'
|
86
|
-
|
86
|
+
ds = Dataset.id(x['id'])
|
87
|
+
result << ds if ds.version
|
87
88
|
else
|
88
89
|
raise Error.new("Unsupported type: #{x['type']} (#{x['name']})")
|
89
90
|
end
|
data/lib/dataverse/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dataverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Dekeyser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
rubygems_version: 3.
|
76
|
+
rubygems_version: 3.1.6
|
77
77
|
signing_key:
|
78
78
|
specification_version: 4
|
79
79
|
summary: Dataverse API.
|