uc3-dmp-id 0.0.99 → 0.0.101

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3bcba612098c1d0acd9a553f25549a198bbefb0f28c9c0ef166038382c17c07
4
- data.tar.gz: 5ba9be2055b9c39a4c887930b5250860cd9dc986ddf4d0248d25e786f932c9fe
3
+ metadata.gz: 9e0229f8a4684d78c921445d06df169216d6694a88264f8f1be8db079c4939f2
4
+ data.tar.gz: 991ec4969b516f29a5302b0700d73be81d15fc7aedfcbdd41e3bb590a399953a
5
5
  SHA512:
6
- metadata.gz: f3b3e728a5c532fb024dddd69a366fc9867e3a05856562c863b89059a38a320d63e70b9d0241249b2a8d419bf8898e894bd93617c681b3601ea82e701433f558
7
- data.tar.gz: 5401aba365595519141ea7f2115366bdaf53b47183ee2fcd3ecba219c9625f8148cc1042faa8f67737f4fb750d60dfe62d2a334ed8e7449a02b8edbd2023744f
6
+ metadata.gz: 287a1c8dac5441229f937dd7e08ace46d8cf0395c4fbdbc43a874f95ff6d1baa0e782b6a98d68c45334ea0eb82390c6c84ae631231cfa8966a04ae1e0a4f4e2c
7
+ data.tar.gz: ecb4bc1d8a8d989cda2b44808f8bfb8f2b883d506884c2fe83b662f7493141fcfa32909f64fed8822d71eec01bf710d41cea0fdb930ba89adf5158dc5a274dff
@@ -7,6 +7,9 @@ module Uc3DmpId
7
7
  class << self
8
8
  # Add assertions to a DMP ID - this is performed by non-provenance systems
9
9
  def add(updater:, dmp:, mods:, note: nil, logger: nil)
10
+
11
+ puts "ADDING ASSERTIONS: #{mods}"
12
+
10
13
  # If the updater and provenance are the same just return the :dmp as-is
11
14
  return dmp if updater.nil? || !dmp.is_a?(Hash) || !mods.is_a?(Hash) ||
12
15
  updater&.gsub('PROVENANCE#', '') == dmp['dmphub_provenance_id']&.gsub('PROVENANCE#', '')
@@ -29,9 +32,15 @@ module Uc3DmpId
29
32
 
30
33
  # Splice together assertions made while the user was updating the DMP ID
31
34
  def splice(latest_version:, modified_version:, logger: nil)
35
+
36
+ puts "LATEST_VERSION ASSERTIONS: #{latest_version['dmphub_assertions']}"
37
+ puts "MODIFIED_VERSION ASSERTIONS: #{modified_version['dmphub_assertions']}"
38
+
32
39
  # 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']
40
+ # user was working on the DMP ID) OR neither version has assertions
41
+ return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at'] ||
42
+ (latest_version.fetch('dmphub_assertions', []).empty? &&
43
+ modified_version.fetch('dmphub_assertions', []).empty?)
35
44
 
36
45
  # Clone any existing assertions on the current DMP ID so we can manipulate them
37
46
  existing_assertions = Helper.deep_copy_dmp(obj: latest_version.fetch('dmphub_assertions', []))
@@ -100,6 +100,9 @@ module Uc3DmpId
100
100
  end
101
101
 
102
102
  def _process_modifications(owner:, updater:, version:, mods:, note: nil, logger: nil)
103
+
104
+ puts "OWNER: #{owner}, UPDATER #{updater}, Version is Hash? #{version.is_a?(Hash)}, Mods is Hash? #{mods.is_a?(Hash)}"
105
+
103
106
  return version unless mods.is_a?(Hash) && !updater.nil?
104
107
  return mods unless version.is_a?(Hash) && !owner.nil?
105
108
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.99'
4
+ VERSION = '0.0.101'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.99
4
+ version: 0.0.101
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley