uc3-dmp-id 0.0.87 → 0.0.88

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: 5157b046943c0704a73d9b1c203dd7f88489a31c22dc0711f857b8b1c2320290
4
- data.tar.gz: 7d0d5d498654e4203b37537c760f61c20bc0647ba785193fc253b745cfd21287
3
+ metadata.gz: 7a80f485c08b9363c829a92644ed5e03dcb10adc185fc0d0bb054d0d9f79cfa0
4
+ data.tar.gz: 239562b558a5fa50b9dfa65fa9d6cfa4719ad161b051c3e53eaff2ba2f3363a8
5
5
  SHA512:
6
- metadata.gz: 3030a6a421a5e5e1e461b5861cc802e6f3851a0759c6783fac640978a6af755cad965728a7e5b77ca6f31d17e7069e087a2fb6ea7563a10ed3f49a036911c3c6
7
- data.tar.gz: 0a41e25fc8b3f9eff0d19620de10a953e0c062472508b3f048d7796dd7ed4d6f91458907f3ee16417d55bca2f9c2a77ae5732a820260f5e5cd883ab3f381f320
6
+ metadata.gz: bba3bb098c384aff4c37a0816b2a968468677124b8ca2a2ce5338ed029d881ab6f2ce6e421dd4b6179d15c93dedbb284dd6903f152610726080cf53833a71797
7
+ data.tar.gz: 72c986c4fea24409cb96ac845888b1cf6b93c5feb6dbce1b9f6e87b1405f78e9735a43c36305aa0751aa83566ab4ad8cc9e8453074177c0f24212738bfcf0d80
@@ -24,19 +24,15 @@ puts annotated
24
24
  # fetch the existing latest version of the DMP ID
25
25
  client = Uc3DmpDynamo::Client.new(debug: debug)
26
26
  existing = Finder.by_pk(p_key: p_key, client: client, debug: debug)
27
-
28
- puts 'EXISTING:'
29
- puts existing
30
-
31
27
  errs = _updateable?(provenance: provenance, p_key: p_key, json: annotated)
32
28
  raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
33
29
  # Don't continue if nothing has changed!
34
- raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: existing, dmp_b: annotated)
30
+ raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: existing, dmp_b: dmp)
35
31
 
36
32
  # Generate a new version of the DMP. This involves versioning the current latest version
37
- new_version = versioner.new_version(p_key: p_key, dmp: annotated)
33
+ new_version = Versioner.new_version(p_key: p_key, dmp: annotated)
38
34
 
39
- puts 'DMP after splicing all changes:'
35
+ puts 'New version:'
40
36
  puts new_version
41
37
 
42
38
  raise UpdaterError, MSG_DMP_UNABLE_TO_VERSION if new_version.nil?
@@ -84,12 +80,8 @@ puts new_version
84
80
  # Validate the incoming JSON first
85
81
  errs = Validator.validate(mode: 'author', json: json)
86
82
  return errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
87
-
88
- puts "Provenance: #{provenance['PK']}, DMP_ID to PK #{Helper.dmp_id_to_pk(json: json['dmp'].fetch('dmp_id', {}))} == P_KEY: #{p_key}"
89
-
90
83
  # Fail if the provenance is not defined
91
84
  return [MSG_DMP_FORBIDDEN] unless provenance.is_a?(Hash) && !provenance['PK'].nil?
92
-
93
85
  # Verify that the JSON is for the same DMP in the PK
94
86
  dmp_id = json['dmp'].fetch('dmp_id', {})
95
87
  return [MSG_DMP_FORBIDDEN] unless Helper.dmp_id_to_pk(json: dmp_id) == p_key
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.87'
4
+ VERSION = '0.0.88'
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.87
4
+ version: 0.0.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley