uc3-dmp-id 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/updater.rb +4 -4
- 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: 1d2311f35cbb8b833394919ecad0432d096db0a9b4344f817cdacd62399a97ec
|
|
4
|
+
data.tar.gz: 7ecdaf2b92b718d69ff0bc102df2fd366e6f9a2701a92a66c61aeb6e2997381a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 302e438282cc47e54ad94c7f1072c6c3f6bb130881c23f2d8c22bed34f17e6b2eb7919e4f17b137e3adc97963316a9fb0e97c651046362e42ae24781fb2318cd
|
|
7
|
+
data.tar.gz: 37c8ee0465b0cd2b398cb40be0aa6b56494a141cacd0161db127d867dd6bb867be5c0b663e5a51cf1eca2803ac3a28dec37ca7a938c5a780f4c48927db4a1e24
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
|
@@ -49,9 +49,6 @@ module Uc3DmpId
|
|
|
49
49
|
# Don't continue if nothing has changed!
|
|
50
50
|
raise UpdaterError, MSG_DMP_NOT_FOUND if dmp.nil?
|
|
51
51
|
|
|
52
|
-
puts "attach_narrative: dmp: #{dmp.class.name}, p_key: #{p_key}, prov: #{provenance['PK']}"
|
|
53
|
-
puts dmp
|
|
54
|
-
|
|
55
52
|
errs = _updateable?(provenance: provenance, p_key: p_key, json: dmp)
|
|
56
53
|
raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
|
|
57
54
|
|
|
@@ -60,6 +57,9 @@ module Uc3DmpId
|
|
|
60
57
|
annotated['dmproadmap_related_identifiers'] = [] if annotated['dmproadmap_related_identifiers'].nil?
|
|
61
58
|
annotated << { descriptor: 'is_metadata_for', work_type: 'output_management_plan', type: 'url', identifier: url }
|
|
62
59
|
|
|
60
|
+
puts "Attached:"
|
|
61
|
+
puts annotated
|
|
62
|
+
|
|
63
63
|
# Save the changes as the new latest version
|
|
64
64
|
resp = client.put_item(json: annotated, debug: debug)
|
|
65
65
|
raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
|
|
@@ -72,7 +72,7 @@ module Uc3DmpId
|
|
|
72
72
|
# Check if the DMP ID is updateable by the provenance
|
|
73
73
|
def _updateable?(provenance:, p_key:, json:)
|
|
74
74
|
# Validate the incoming JSON first
|
|
75
|
-
errs = Validator.validate(mode: 'author', json: json)
|
|
75
|
+
errs = Validator.validate(mode: 'author', json: json)
|
|
76
76
|
return errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
|
|
77
77
|
|
|
78
78
|
# Fail if the provenance is not defined
|
data/lib/uc3-dmp-id/version.rb
CHANGED