uc3-dmp-id 0.1.69 → 0.1.71
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 +13 -9
- 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: 06d836115caac7a07306686448df2e596b9d77f54368e4fb5f1e1f921e8c7ad6
|
4
|
+
data.tar.gz: afd13d10029262be80f08cc86516292567162bbd87679fe467b0dd23c1b5d72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aef2a4c77b3ee99d13f4aac02f544b978e5f7c84495e7fedcf0588f0ffa8efe495be8dc05e984487873620b292da3f9f1bf3e33a6119bbdce26c845df3161ac0
|
7
|
+
data.tar.gz: 87b47716904176310c6add2c3c7d376077ec462edfa6063b1f7f295b557c78ad4852e6bb3174a68c053b088ee1f8eefe2d43ea80f8d62ee10521fb0c83086a9c
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -51,7 +51,7 @@ module Uc3DmpId
|
|
51
51
|
|
52
52
|
# Splice the assertions
|
53
53
|
version = _process_modifications(owner:, updater:, version:, mods:, logger:)
|
54
|
-
logger&.debug(message: 'Mods after process_modifications', details:
|
54
|
+
logger&.debug(message: 'Mods after process_modifications', details: version)
|
55
55
|
|
56
56
|
# Set the :modified timestamps
|
57
57
|
now = Time.now.utc
|
@@ -207,21 +207,25 @@ module Uc3DmpId
|
|
207
207
|
logger&.debug(message: 'Original HARVESTER_MODS record', details: resp)
|
208
208
|
# The `dmphub_modifications` array will ONLY ever have things the harvester mods know about
|
209
209
|
# so just find them and update the status accordingly
|
210
|
-
|
210
|
+
original = resp.dup
|
211
211
|
json['dmphub_modifications'].each do |entry|
|
212
212
|
next if entry.fetch('dmproadmap_related_identifiers', []).empty?
|
213
213
|
|
214
214
|
entry['dmproadmap_related_identifiers'].each do |related|
|
215
|
-
related_id =
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
215
|
+
related_id = related.respond_to?(:identifier) ? related.identifier : related['identifier']
|
216
|
+
related_domain = related.respond_to?(:identifier) ? related.domain : related['domain']
|
217
|
+
key = "#{related_domain.end_with?('/') ? related_domain : "#{related_domain}/"}#{related_id}"
|
218
|
+
key_found = original['related_works'].has_key?(key)
|
219
|
+
logger&.debug(message: "No matching HARVEST_MOD found for #{key}") unless key_found
|
220
|
+
next unless key_found
|
221
|
+
|
222
|
+
logger&.debug(message: "Updating status for #{key} from #{original['related_works'][key]['status']} to #{related['status']}")
|
223
|
+
original['related_works'][key]['status'] = related['status']
|
220
224
|
end
|
221
225
|
end
|
222
226
|
|
223
|
-
logger&.debug(message: 'Updating HARVESTER_MODS with:', details:
|
224
|
-
client.put_item(json:
|
227
|
+
logger&.debug(message: 'Updating HARVESTER_MODS with:', details: original)
|
228
|
+
client.put_item(json: original, logger:)
|
225
229
|
json.delete('dmphub_modifications')
|
226
230
|
logger&.debug(message: 'After deleting dmphub_modifications:', details: json)
|
227
231
|
json
|
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.1.
|
4
|
+
version: 0.1.71
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|