uc3-dmp-id 0.0.107 → 0.0.109
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/updater.rb +3 -15
- 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: 2904670927e7a3f94ab9396ea89145c6526a9df02a6ac75beb5231920c4a16ff
|
4
|
+
data.tar.gz: 05ff04ea8ec68d06b8f0854269d511422019ced71f1d2347aef4232a0175c564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e16cb5b1ad93195b0244645faa04144c6f88aec037340529d5190b7b7cff1b5308e5273cec5a654ecad0b4624468464500ca9e5ce08034261a793d44ba3c056f
|
7
|
+
data.tar.gz: 259be986f9f8e4d4d91f7d39558e6dda44290ed3ea4dbf727bd8c7e92f74da8419e962cf9f7d511c6ae4dd620b18b29acdb2bd409a8430c98bdfae34bf55e361
|
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'])
|
@@ -117,7 +106,6 @@ puts version
|
|
117
106
|
updated = Asserter.splice(latest_version: version, modified_version: mods, logger: logger) if owner == updater
|
118
107
|
|
119
108
|
# Attach the incoming changes as an assertion to the DMP ID since the updater is NOT the owner
|
120
|
-
updater = provenance['PK']
|
121
109
|
updated = Asserter.add(updater: updater, dmp: version, mods: mods, note: note, logger: logger) if owner != updater
|
122
110
|
|
123
111
|
merge_versions(latest_version: version, mods: updated, logger: logger)
|
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.109
|
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
|