uc3-dmp-id 0.0.98 → 0.0.100
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/asserter.rb +7 -2
- data/lib/uc3-dmp-id/updater.rb +1 -1
- 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: 980cf55dcebe87df7656894c5322def896fc16863fc8e1bb4d5a2c3f44c289df
|
4
|
+
data.tar.gz: 94dd8f43a9dc1108fe030f6651ea858f3445d6f27a42ba7f448fe4c311b180cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c54010fb9da4a20dd0604f7a88105aa79cb7129f8167abee1fd61d8bd1ea5a0186e721eab95cc46d71b227bd7faf8f98174bc91813f5cfac5a052cdb7956f75
|
7
|
+
data.tar.gz: 7033cdaf7cddb6dcfe307fd33117e472fe69068d23b34b545cca023452382da953c73ed7f4c525e3ff7e07400d3df0eaeeafb3db3742f98a2941877d6ca80df6
|
data/lib/uc3-dmp-id/asserter.rb
CHANGED
@@ -30,8 +30,13 @@ module Uc3DmpId
|
|
30
30
|
# Splice together assertions made while the user was updating the DMP ID
|
31
31
|
def splice(latest_version:, modified_version:, logger: nil)
|
32
32
|
# Return the modified_version if the timestamps are the same (meaning no new assertions were made while the
|
33
|
-
# user was working on the DMP ID)
|
34
|
-
return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at']
|
33
|
+
# user was working on the DMP ID) OR neither version has assertions
|
34
|
+
return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at'] ||
|
35
|
+
(latest_version.fetch('dmphub_assertions', []).empty? &&
|
36
|
+
modified_version.fetch('dmphub_assertions', []).empty?)
|
37
|
+
|
38
|
+
puts "LATEST_VERSION ASSERTIONS: #{latest_version['dmphub_assertions']}"
|
39
|
+
puts "MODIFIED_VERSION ASSERTIONS: #{modified_version['dmphub_assertions']}"
|
35
40
|
|
36
41
|
# Clone any existing assertions on the current DMP ID so we can manipulate them
|
37
42
|
existing_assertions = Helper.deep_copy_dmp(obj: latest_version.fetch('dmphub_assertions', []))
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -29,7 +29,7 @@ module Uc3DmpId
|
|
29
29
|
logger.error(message: errs.join(', ')) if errs.is_a?(Array) && errs.any?
|
30
30
|
raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
|
31
31
|
# Don't continue if nothing has changed!
|
32
|
-
raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a:
|
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
35
|
owner = latest_version['dmphub_provenance_id']
|
data/lib/uc3-dmp-id/version.rb
CHANGED