uc3-dmp-id 0.0.95 → 0.0.97

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: 66da5763a8775630aa772cda55e95ea3a851b0f64e28d0c37c35e2c31d96d57e
4
- data.tar.gz: '08ad0dcb0490ac289b674fa9d8a8fdf704a1f9a50020d42fa10d208a34f86771'
3
+ metadata.gz: 1b18b3d95b39f2da88fa37724c6fda10a5b52ca9f12c846a931d2437c2d765ba
4
+ data.tar.gz: bf97c7cd424030c19c720fff5011f9f6605aa375d6c9bf0f962f4ffd10174742
5
5
  SHA512:
6
- metadata.gz: 2a2e0c1288b03cb7457f7bb750a3d44a673059640f2d28c4be8f33be52e2fc2fe10c1c8e4e6fde14f6e478111301236271945312a3b2d3c6b171597dfad035bd
7
- data.tar.gz: 86af35a5e87a1bf29b814d0843e06199c351c43605d0cfc84cd2f26728ebcfaee3511766243a9d7c19247cb1be6d9b47873af8cfdb5c1a1650956e45bb6e6d85
6
+ metadata.gz: 791986d2bf6e7382ad4f1bf84a7e4c6c7d501609a1dfe4d0d3aec0d3554496a5637231db298a01481ec18f0e1055b82c95158cd203a53a6aecbbf8ba4ddb6109
7
+ data.tar.gz: f0baea87de3fb99225c98bbce5df28adf9ef32fc90593c32334d5094acf2314ea5c9d01d53088bbf1bc5529cdd9f496061aa8544b40687f7624cdde7991e59a0
@@ -40,7 +40,7 @@ module Uc3DmpId
40
40
  raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if resp.nil?
41
41
 
42
42
  # Send the updates to EZID, notify the provenance and download the PDF if applicable
43
- _post_process(json: dmp, logger: logger)
43
+ _post_process(provenance: provenance, json: dmp, logger: logger)
44
44
  # Return the new version record
45
45
  logger.info(message: "Updated DMP ID: #{p_key}") if logger.respond_to?(:debug)
46
46
  Helper.cleanse_dmp_json(json: JSON.parse({ dmp: new_version }.to_json))
@@ -90,11 +90,11 @@ module Uc3DmpId
90
90
 
91
91
  # Once the DMP has been updated, we need to register it's DMP ID and download any PDF if applicable
92
92
  # -------------------------------------------------------------------------
93
- def _post_process(json:, logger: nil)
93
+ def _post_process(provenance:, json:, logger: nil)
94
94
  return false unless json.is_a?(Hash)
95
95
 
96
96
  # Indicate whether or not the updater is the provenance system
97
- json['dmphub_updater_is_provenance'] = @provenance['PK'] == json['dmphub_provenance_id']
97
+ json['dmphub_updater_is_provenance'] = provenance['PK'] == json['dmphub_provenance_id']
98
98
  # Publish the change to the EventBridge
99
99
  publisher = Uc3DmpEventBridge::Publisher.new
100
100
  publisher.publish(source: 'DmpUpdater', dmp: json, logger: logger)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.95'
4
+ VERSION = '0.0.97'
5
5
  end
@@ -36,16 +36,16 @@ module Uc3DmpId
36
36
  puts "Provenance: #{provenance}, PK: #{p_key}"
37
37
  puts dmp
38
38
 
39
- return nil unless p_key.is_a?(String) && !p_key.strip.empty? && _versionable?(p_key: p_key, dmp: latest_version)
39
+ return nil unless p_key.is_a?(String) && !p_key.strip.empty? && _versionable?(p_key: p_key, dmp: latest_version['dmp'])
40
40
 
41
41
  client = Uc3DmpDynamo::Client.new if client.nil?
42
42
 
43
43
  owner = latest_version['dmphub_provenance_id']
44
44
  updater = provenance['PK']
45
- prior = _generate_version(client: client, latest_version: latest_version, owner: owner, updater: updater)
45
+ prior = _generate_version(client: client, latest_version: latest_version['dmp'], owner: owner, updater: updater)
46
46
  return nil if prior.nil?
47
47
 
48
- args = { owner: owner, updater: updater, base: prior, mods: dmp, logger: logger }
48
+ args = { owner: owner, updater: updater, base: prior, mods: dmp['dmp'], logger: logger }
49
49
  logger.debug(message: "#{SOURCE} record prior to splicing", details: dmp) if logger.respond_to?(:debug)
50
50
 
51
51
  # If the system of provenance is making the change then just use the
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.95
4
+ version: 0.0.97
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley