uc3-dmp-id 0.0.49 → 0.0.51
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/creator.rb +7 -7
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfeca7fa5375efa50a0ebcf8226695a7a172d9664a7a97444d8654b01e67a088
|
4
|
+
data.tar.gz: 2a31f49349406d4622653ed033029d22ae9deeb375b4323f1248860250ce0378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3a0d5540564443aebe581e57f9d026db7caa7dd89cc9dd9128e5ad75278703b29ea8a1442d42d8a849ee84fcdd793d709f16ec241c4b109390387e544f6317
|
7
|
+
data.tar.gz: 5143d9fca0e5f8352c48b1bacecdab81f5a7d05acf29bda69b54fe28cddda4a8f3c843f27d559f1f4b84aab326655b1689d6b0b69516be6d8c2ed54cc34c7c9b
|
data/lib/uc3-dmp-id/creator.rb
CHANGED
@@ -29,9 +29,9 @@ module Uc3DmpId
|
|
29
29
|
|
30
30
|
# TODO: Swap this out with the Finder search once the Dynamo indexes are working
|
31
31
|
# Try to find it first and Fail if found
|
32
|
-
|
33
|
-
|
34
|
-
raise CreatorError, Uc3DmpId::MSG_DMP_EXISTS unless json['PK'].nil?
|
32
|
+
result = Finder.by_json(json: json, debug: debug)
|
33
|
+
raise CreatorError, Uc3DmpId::MSG_DMP_EXISTS if result.is_a?(Hash)
|
34
|
+
# raise CreatorError, Uc3DmpId::MSG_DMP_EXISTS unless json['PK'].nil?
|
35
35
|
|
36
36
|
client = Uc3DmpDynamo::Client.new(debug: debug)
|
37
37
|
p_key = _preregister_dmp_id(client: client, provenance: provenance, json: json, debug: debug)
|
@@ -54,18 +54,18 @@ module Uc3DmpId
|
|
54
54
|
|
55
55
|
def _preregister_dmp_id(client:, provenance:, json:, debug: false)
|
56
56
|
# Use the specified DMP ID if the provenance has permission
|
57
|
-
existing = json.fetch('dmp_id', {})
|
57
|
+
existing = json.fetch('dmp', {}).fetch('dmp_id', {})
|
58
58
|
id = existing['identifier'].gsub(%r{https?://}, Helper::PK_DMP_PREFIX) if existing.is_a?(Hash) &&
|
59
59
|
!existing['identifier'].nil?
|
60
60
|
|
61
61
|
puts "_preregister_dmp_id:"
|
62
62
|
puts provenance
|
63
|
+
puts json
|
63
64
|
puts id
|
64
65
|
|
65
|
-
|
66
66
|
return id if !id.nil? &&
|
67
|
-
existing
|
68
|
-
provenance
|
67
|
+
existing.fetch('type', 'other').to_s.downcase == 'doi' &&
|
68
|
+
provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true' &&
|
69
69
|
!Finder.exists?(client: client, p_key: id)
|
70
70
|
|
71
71
|
dmp_id = ''
|
data/lib/uc3-dmp-id/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|