uc3-dmp-id 0.0.108 → 0.0.110
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/finder.rb +3 -3
- data/lib/uc3-dmp-id/updater.rb +3 -14
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b951a79fba1e0ca52529329628da1616600cc7a6f37c25d357c35652caf7ba7
|
4
|
+
data.tar.gz: 362d3e8d02de8e407553ff2e71a680b4ec9eaf7e272998a4e6dc1de3923fd81f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b0c3ca513b975699cdf5c42943d98c38d43f5ac374d320dececcad9b9a9eb44b8549361f7ce13fbd3be72fe10fcc0a048bfec0d08340f9bffa2cb9691ab0094
|
7
|
+
data.tar.gz: c8c50c7345444d2209f75cc26f3531e4ca28b1bc73bb3679dc09a6f6b6f5d3fa2b895901dd75a9f4338e6deefcfd50dd175bea75ad06c2ad9a409bec9b3610c1
|
data/lib/uc3-dmp-id/finder.rb
CHANGED
@@ -129,7 +129,7 @@ module Uc3DmpId
|
|
129
129
|
"http://orcid.org/#{owner_id.to_s.downcase}",
|
130
130
|
"https://orcid.org/#{owner_id.to_s.downcase}"
|
131
131
|
],
|
132
|
-
comparison_operator: '
|
132
|
+
comparison_operator: 'IN'
|
133
133
|
}
|
134
134
|
},
|
135
135
|
filter_expression: 'SK = :version',
|
@@ -153,7 +153,7 @@ module Uc3DmpId
|
|
153
153
|
"http://ror.org/#{owner_org.to_s.downcase}",
|
154
154
|
"https://ror.org/#{owner_org.to_s.downcase}"
|
155
155
|
],
|
156
|
-
comparison_operator: '
|
156
|
+
comparison_operator: 'IN'
|
157
157
|
}
|
158
158
|
},
|
159
159
|
filter_expression: 'SK = :version',
|
@@ -174,7 +174,7 @@ module Uc3DmpId
|
|
174
174
|
key_conditions: {
|
175
175
|
dmphub_modification_day: {
|
176
176
|
attribute_value_list: [day.to_s],
|
177
|
-
comparison_operator: '
|
177
|
+
comparison_operator: 'IN'
|
178
178
|
}
|
179
179
|
},
|
180
180
|
filter_expression: 'SK = :version',
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -32,26 +32,16 @@ module Uc3DmpId
|
|
32
32
|
raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: latest_version, dmp_b: mods)
|
33
33
|
|
34
34
|
# Version the DMP ID record (if applicable).
|
35
|
-
|
36
|
-
puts "DMPHub PROV: #{latest_version['dmphub_provenance_id']}, DMP BURIED: #{latest_version.fetch('dmp', {})['dmphub_provenance_id']}"
|
37
|
-
|
38
35
|
owner = latest_version['dmphub_provenance_id']
|
39
36
|
updater = provenance['PK']
|
40
37
|
version = Versioner.generate_version(client: client, latest_version: latest_version, owner: owner, updater: updater,
|
41
38
|
logger: logger)
|
42
39
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if version.nil?
|
43
40
|
|
44
|
-
puts "OWNER AFTER VERSION: #{owner}"
|
45
|
-
puts version
|
46
|
-
|
47
|
-
|
48
41
|
# Splice the assertions
|
49
42
|
version = _process_modifications(owner: owner, updater: updater, version: version, mods: mods, note: note,
|
50
43
|
logger: logger)
|
51
44
|
|
52
|
-
puts "AFTER PROCESING MODS:"
|
53
|
-
puts version
|
54
|
-
|
55
45
|
# Save the changes
|
56
46
|
resp = client.put_item(json: version, logger: logger)
|
57
47
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
@@ -73,11 +63,10 @@ puts version
|
|
73
63
|
|
74
64
|
# fetch the existing latest version of the DMP ID
|
75
65
|
client = Uc3DmpDynamo::Client.new(logger: logger)
|
76
|
-
dmp = Finder.by_pk(p_key: p_key, client: client, logger: logger)
|
66
|
+
dmp = Finder.by_pk(p_key: p_key, client: client, logger: logger, cleanse: false)
|
77
67
|
logger.info(message: "Existing latest record", details: dmp) if logger.respond_to?(:debug)
|
78
|
-
|
79
|
-
|
80
|
-
raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
|
68
|
+
raise UpdaterError, MSG_DMP_FORBIDDEN unless provenance.is_a?(Hash) && !provenance['PK'].nil? &&
|
69
|
+
provenance['Pk'] == dmp['dmphub_provenance_id']
|
81
70
|
|
82
71
|
# Add the download URl for the PDF as a related identifier on the DMP ID record
|
83
72
|
annotated = Helper.annotate_dmp_json(provenance: provenance, p_key: p_key, json: dmp['dmp'])
|
data/lib/uc3-dmp-id/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.110
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|