uc3-dmp-id 0.0.29 → 0.0.31

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: d3b21e9c1f4c217bfeec57e033c2516a09f0e23d426d7f9fbf13a225bbd4824c
4
- data.tar.gz: 8b3fd850e2301b032b2aecdf0e84878f1526d7b42499505402aac045d37b16fe
3
+ metadata.gz: d5b26fcb35c29e0e10f7becd2288f81c91b0c9d915f52e15c2c1e6eb13951333
4
+ data.tar.gz: ba9efe6d581580c2c74313c4a88804c1f28a152a057b30ff66c84d10b9150ebc
5
5
  SHA512:
6
- metadata.gz: ac256390f7852b18a633eed62279318a5d4b282f579b8c6ed3ac84fe0dfb188b915e17b11342608c7c7d1ef5dc6872ab81c68eb1da13f42bf52b7b31be618065
7
- data.tar.gz: 9ba658b187f9a4e4ba465448b6e11f466c9881f1e108c88b4aec698eb747349b71d9805e50ff66cf2bf7153ad9af99860de8d11136c8446b7ff69652648c4cc1
6
+ metadata.gz: b50d96d616da07d16445eed9795d20b53ff824a99f4661556fa45654b6c967487c378d390235ac7b12c85fac30a4a6c9c52c6982fc57be9b7b6f22b99c5cb444
7
+ data.tar.gz: c781cd5e543dab4c6875d3db4277ada23219d1505742361f15ea3c2c67fc56f5d8255622784e350b22d18b09d6b766d2725cc2ec5400a26ea29ac65959038bb2
@@ -20,7 +20,7 @@ module Uc3DmpId
20
20
 
21
21
  # Validate the incoming JSON first
22
22
  errs = Validator.validate(mode: 'author', json: Helper.parse_json(json: json))&.fetch('dmp', {})
23
- raise CreatorError, errs.join(', ') if errs.is_a?(Array) && errs.any?
23
+ raise CreatorError, errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
24
24
 
25
25
  # Fail if the provenance or owner affiliation are not defined
26
26
  raise CreatorError, MSG_NO_PROVENANCE_OWNER if provenance.nil? || owner_org.nil?
@@ -47,7 +47,7 @@ module Uc3DmpId
47
47
  def _updateable?(provenance:, p_key:, json:)
48
48
  # Validate the incoming JSON first
49
49
  errs = Validator.validate(mode: 'author', json: json)&.fetch('dmp', {})
50
- return errs.join(', ') if errs.is_a?(Array) && errs.any?
50
+ return errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
51
51
 
52
52
  # Fail if the provenance is not defined
53
53
  return [MSG_DMP_FORBIDDEN] unless provenance.is_a?(Hash) && !provenance['PK'].nil?
@@ -51,7 +51,7 @@ puts "Schemas::Author defined? #{Object.const_defined?('Schemas::Author')}"
51
51
  puts "Author defined? #{Object.const_defined?('Author')}"
52
52
 
53
53
  # Instatiate the matching schema
54
- schema = "Uc3DmpId::Schemas::#{mode.to_s.downcase.capitalize}".split('::').inject(Object) { |o,c| o.const_get c }
54
+ schema = "Uc3DmpId::Schemas::#{mode.to_s.downcase.capitalize}".split('::').inject(Object) { |o,c| p o; o.const_get c }
55
55
  schema.respond_to?(:load) ? schema.load : nil
56
56
  end
57
57
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.29'
4
+ VERSION = '0.0.31'
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.29
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley