uc3-dmp-id 0.0.103 → 0.0.105
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 +10 -5
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e989d8d3d5932bb292a7116d479b6ccaf57611741d0af54e6e31a9177a0a5fa
|
4
|
+
data.tar.gz: 10bef83307a97389e8cb512fb83a6558259f569c4e69225c023c77553060fca5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afbd3c9861c4d26d0b9002c28cea9443522e77300ceb24c80d15812725637508312cbcae33bf355c4386fe9aa51b34ccf4f52275a18e910363e7ff46b77b71b
|
7
|
+
data.tar.gz: 8c79f4ac8d1ed0f44ee13512d006488b52af89983f5835a70fc80e773f8c92311bd66b286a2abba2a4a963dd3fa1891c2258a03a2574e15ea51bc958c3ae8bbe
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -41,10 +41,17 @@ puts "DMPHub PROV: #{latest_version['dmphub_provenance_id']}, DMP BURIED: #{late
|
|
41
41
|
logger: logger)
|
42
42
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if version.nil?
|
43
43
|
|
44
|
+
puts "OWNER AFTER VERSION: #{owner}"
|
45
|
+
puts version
|
46
|
+
|
47
|
+
|
44
48
|
# Splice the assertions
|
45
49
|
version = _process_modifications(owner: owner, updater: updater, version: version, mods: mods, note: note,
|
46
50
|
logger: logger)
|
47
51
|
|
52
|
+
puts "AFTER PROCESING MODS:"
|
53
|
+
puts version
|
54
|
+
|
48
55
|
# Save the changes
|
49
56
|
resp = client.put_item(json: version, logger: logger)
|
50
57
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
@@ -103,16 +110,14 @@ puts "DMPHub PROV: #{latest_version['dmphub_provenance_id']}, DMP BURIED: #{late
|
|
103
110
|
end
|
104
111
|
|
105
112
|
def _process_modifications(owner:, updater:, version:, mods:, note: nil, logger: nil)
|
106
|
-
|
107
|
-
puts "OWNER: #{owner}, UPDATER #{updater}, Version is Hash? #{version.is_a?(Hash)}, Mods is Hash? #{mods.is_a?(Hash)}"
|
108
|
-
|
109
113
|
return version unless mods.is_a?(Hash) && !updater.nil?
|
110
114
|
return mods unless version.is_a?(Hash) && !owner.nil?
|
111
115
|
|
112
116
|
# Splice together any assertions that may have been made while the user was editing the DMP ID
|
113
|
-
Asserter.splice(latest_version: version, modified_version: mods, logger: logger) if owner == updater
|
117
|
+
return Asserter.splice(latest_version: version, modified_version: mods, logger: logger) if owner == updater
|
118
|
+
|
114
119
|
# Attach the incoming changes as an assertion to the DMP ID since the updater is NOT the owner
|
115
|
-
Asserter.add(updater: provenance['PK'], dmp: version, mods: mods, note: note, logger: logger)
|
120
|
+
Asserter.add(updater: provenance['PK'], dmp: version, mods: mods, note: note, logger: logger)
|
116
121
|
end
|
117
122
|
|
118
123
|
# Once the DMP has been updated, we need to update it's DOI metadata
|
data/lib/uc3-dmp-id/version.rb
CHANGED