uc3-dmp-id 0.0.41 → 0.0.42

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: a083adf1ce95bf86fe7775c5c76fa12758f90747502daa8a9f2140cc9b50743b
4
- data.tar.gz: 3fdf9a0f471daa92bcd663892cb4b40f306be417fbab94a0a9bad6a65a600134
3
+ metadata.gz: a0fef469bbcc71541818da66343150f5f8d836da7fea95e584814676504fc0ab
4
+ data.tar.gz: d33e5f4b658a3cc10af320a43712c39dc8876e94d463ca610b1c35f3845c8781
5
5
  SHA512:
6
- metadata.gz: 4c7b1e2f15ee9408b07d42902025bfe99f9c8dbf533ad013289147fefe21f6c42ccdff322417ec98ee1473ee424339905d71429a3fb1f2dded7b9cf55d997864
7
- data.tar.gz: 59175eb9fd83d0dea579e030db380ce7fb45a632edcc339739c0c57dd564dde03f93e5274974e3d3a28fd4f6a76172b1fccb6d10dd63d5d937e32ae32904f8e6
6
+ metadata.gz: e2b2393f62e7a78df241ef998107817fe569c0de4362ca2e2451a471bb8e029717acad65dc48a4c12840885060110f750864d14a2d9ffaf3bd34f1eb78c59a05
7
+ data.tar.gz: 76b1ad4c83ebceccea8fdb0932615dfd930b306bfd604d240a39d42b21ffbcb694c17455d1596393f7ff71a00700c2b82c488d31739a07eca340d86c966b2c13
@@ -19,7 +19,8 @@ module Uc3DmpId
19
19
  raise DeleterError, MSG_DMP_FORBIDDEN unless provenance.is_a?(Hash) && !provenance['PK'].nil?
20
20
 
21
21
  # Validate the incoming JSON first
22
- errs = Validator.validate(mode: 'author', json: Helper.parse_json(json: json))
22
+ json = Helper.parse_json(json: json)
23
+ errs = Validator.validate(mode: 'author', json: json)
23
24
  raise CreatorError, errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
24
25
 
25
26
  # Fail if the provenance or owner affiliation are not defined
@@ -56,7 +57,7 @@ module Uc3DmpId
56
57
  existing = json.fetch('dmp_id', {})
57
58
  id = existing['identifier'].gsub(%r{https?://}, Helper::PK_DMP_PREFIX) if existing.is_a?(Hash) &&
58
59
  !existing['identifier'].nil?
59
- return id if existing['type'].downcase == 'doi' && !id.nil? && !Finder.exists?(p_key: id)
60
+ return id if !id.nil? && existing['type'].downcase == 'doi' && !Finder.exists?(p_key: id)
60
61
 
61
62
  dmp_id = ''
62
63
  counter = 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.41'
4
+ VERSION = '0.0.42'
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.41
4
+ version: 0.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley