uc3-dmp-id 0.0.86 → 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: 10b352f851836dba94128f686ead56e57f9b4ebdbd60d2fec07875c168ceab02
4
- data.tar.gz: 3ebc392cacd0ffff66f0c482463975244021a2b11c046226c27bde091cab1817
3
+ metadata.gz: 7a80f485c08b9363c829a92644ed5e03dcb10adc185fc0d0bb054d0d9f79cfa0
4
+ data.tar.gz: 239562b558a5fa50b9dfa65fa9d6cfa4719ad161b051c3e53eaff2ba2f3363a8
5
5
  SHA512:
6
- metadata.gz: c49e77cf0c1d2d4436e6396b98e4cc4b7681d3345925dc27690e81371104aac3d1669e1fee6570c494dd8ec871824884522fb76d11242fd45f2f8fa27478e3b2
7
- data.tar.gz: 321d0ab84681502923e2bb39d8d1e50ef8b3ad9196d3e98e80eccb2a284d8d202fd596990eacda27ef8b4207e7d1a15af2fd947b71b55dad58bbb4b4771ed08f
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
- errs = _updateable?(provenance: provenance, p_key: p_key, json: existing)
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,17 +80,11 @@ 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
96
- # Make sure they're not trying to update a historical copy of the DMP
97
- return [MSG_DMP_NO_HISTORICALS] if json['SK'] != Helper::DMP_LATEST_VERSION
98
88
  end
99
89
 
100
90
  # Once the DMP has been updated, we need to register it's DMP ID and download any PDF if applicable
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.86'
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.86
4
+ version: 0.0.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley