uc3-dmp-id 0.0.100 → 0.0.101

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 980cf55dcebe87df7656894c5322def896fc16863fc8e1bb4d5a2c3f44c289df
4
- data.tar.gz: 94dd8f43a9dc1108fe030f6651ea858f3445d6f27a42ba7f448fe4c311b180cd
3
+ metadata.gz: 9e0229f8a4684d78c921445d06df169216d6694a88264f8f1be8db079c4939f2
4
+ data.tar.gz: 991ec4969b516f29a5302b0700d73be81d15fc7aedfcbdd41e3bb590a399953a
5
5
  SHA512:
6
- metadata.gz: 1c54010fb9da4a20dd0604f7a88105aa79cb7129f8167abee1fd61d8bd1ea5a0186e721eab95cc46d71b227bd7faf8f98174bc91813f5cfac5a052cdb7956f75
7
- data.tar.gz: 7033cdaf7cddb6dcfe307fd33117e472fe69068d23b34b545cca023452382da953c73ed7f4c525e3ff7e07400d3df0eaeeafb3db3742f98a2941877d6ca80df6
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,15 +32,16 @@ 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
40
  # user was working on the DMP ID) OR neither version has assertions
34
41
  return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at'] ||
35
42
  (latest_version.fetch('dmphub_assertions', []).empty? &&
36
43
  modified_version.fetch('dmphub_assertions', []).empty?)
37
44
 
38
- puts "LATEST_VERSION ASSERTIONS: #{latest_version['dmphub_assertions']}"
39
- puts "MODIFIED_VERSION ASSERTIONS: #{modified_version['dmphub_assertions']}"
40
-
41
45
  # Clone any existing assertions on the current DMP ID so we can manipulate them
42
46
  existing_assertions = Helper.deep_copy_dmp(obj: latest_version.fetch('dmphub_assertions', []))
43
47
  incoming_assertions = Helper.deep_copy_dmp(obj: modified_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.100'
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.100
4
+ version: 0.0.101
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley